How to use String and Date/Time Functions in MySQL?
Demonstrates built-in CONCAT, UPPER, LOWER, SUBSTRING, DATEDIFF, and DATE_FORMAT helpers.
SELECT
CONCAT(first_name, ' ', last_name) AS full_name,
UPPER(first_name) AS upper_name,
LENGTH(email) AS email_length,
DATE_FORMAT(hire_date, '%W, %M %e, %Y') AS formatted_date,
DATEDIFF(CURRENT_DATE, hire_date) AS days_employed
FROM employees
WHERE employee_id = 1;+-----------+------------+--------------+--------------------------+---------------+ | full_name | upper_name | email_length | formatted_date | days_employed | +-----------+------------+--------------+--------------------------+---------------+ | John Doe | JOHN | 20 | Monday, January 15, 2024 | 960 | +-----------+------------+--------------+--------------------------+---------------+