Average Tenure per Department
Medium
HR Analytics
Treat 2026-10-06 as today. Return each department's average completed years of service (whole years per employee) rounded to one decimal. Order by department_id.
Table schema
Employees(id INT PRIMARY KEY, department_id INT, hire_date DATE)Sample data
id | department_id | hire_date
1 | 1 | 2020-10-06
2 | 1 | 2022-10-06
3 | 2 | 2025-10-06
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.