Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.