SQLSQL
#26

Calculate Average Experience Per Project in SQL

Easy
Interview Question #26

Given `project` (project_id, employee_id) and `employee` (employee_id, experience_years), write a query to report the average experience years of all employees for each project, rounded to 2 decimal places.

Input Table: project & employee
5 rows preview
project_idemployee_idexperience_years
113
122
131
213
246
Expected Output Structure2 rows
project_idaverage_years
12
24.5
Interview Context

Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.

SQLPostgreSQL 15
Ready to execute

Click "Run Query" or press Ctrl + Enter to test your query.

Output will be verified against the test dataset.

Chat with us