Find Department With Highest Average Tenure

Find the department with the highest average employee tenure.

sql

SELECT department_name, AVG(tenure_years) AS average_tenure FROM employees GROUP BY department_name ORDER BY average_tenure DESC LIMIT 1;

This query calculates the average tenure for each department, sorts the results in descending order, and returns the department with the highest value.

PromptDB can make mistakes. Please double-check responses.