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.
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.
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.
Project table: proj1 has employees 1,2. Employee table: emp1=5yrs, emp2=3yrs. Project 1 average: (5+3)/2 = 4.00 years.
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."
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Duplicate Emails | Easy | Solve | |
| Fix Names in a Table | Easy | Solve | |
| Not Boring Movies | Easy | Solve | |
| Primary Department for Each Employee | Easy | Solve | |
| Queries Quality and Percentage | Easy | Solve |