Magicsheet logo

Project Employees I

Easy
12.5%
Updated 8/1/2025

Project Employees I

What is this problem about?

The Project Employees I SQL problem asks you to find the average experience years of all employees for each project. This easy SQL problem tests JOIN with GROUP BY and AVG. The database interview pattern is demonstrated.

Why is this asked in interviews?

Microsoft, Meta, Amazon, Google, and Bloomberg ask this as a standard JOIN + aggregate problem — testing that candidates can combine two tables, group by project, and compute averages.

Algorithmic pattern used

JOIN + GROUP BY + AVG + ROUND. SELECT p.project_id, ROUND(AVG(e.experience_years), 2) AS average_years FROM Project p JOIN Employee e ON p.employee_id = e.employee_id GROUP BY p.project_id.

Example explanation

Project table: proj1 has employees 1,2. Employee table: emp1=5yrs, emp2=3yrs. Project 1 average: (5+3)/2 = 4.00 years.

Common mistakes candidates make

  • Not rounding to 2 decimal places.
  • Using SUM/COUNT instead of AVG.
  • Not joining to get experience_years.
  • Grouping by employee_id instead of project_id.

Interview preparation tip

Project Employees I is the template for "average metric per group" SQL queries. Always: JOIN to get the metric, GROUP BY the key, aggregate with AVG. The ROUND(AVG(...), 2) pattern is standard for financial and HR analytics queries. Practice: "average salary by department," "average rating by product," "average time per category."

Similar Questions