Query Employees Joined During Last Year

Find employees who joined last year.

sql

SELECT id, name, joined_at FROM employees WHERE YEAR(joined_at) = YEAR(CURDATE()) - 1;

This query selects the "id", "name", and "joined_at" columns from the "employees" table for records where the year of the "joined_at" date is equal to the previous calendar year.

PromptDB can make mistakes. Please double-check responses.