Query Employees With Five Years Tenure

Find employees who have completed more than 5 years in the company.

sql

SELECT id, name, hire_date FROM employees WHERE hire_date <= CURRENT_DATE - INTERVAL 5 YEAR;

This query selects the id, name, and hire_date from the employees table for all records where the hire_date is at least five years prior to the current date.

PromptDB can make mistakes. Please double-check responses.