Project Employees I

2pts
Linked In

Problem Statement

Project managers at LinkedIn want to analyze the seniority level of different project teams to ensure a balanced mix of junior and senior talent.

Write an SQL query that reports the average experience years of all the employees for each project, rounded to 2 digits.

Rules:

  • The average must be calculated per project_id.
  • Round the resulting average to exactly 2 decimal places.
  • Return the project_id and the calculated average_years.
  • Results must be sorted by project_id in ascending order.
Tests your understanding of
Basic SQL, Joins, Aggregation, Rounding and Math Functions

Input Tables

project
project_id(INTEGER)employee_id(INTEGER)
11
12
13
21
24
employee
employee_id(INTEGER)name(VARCHAR)experience_years(INTEGER)
1Khaled3
2Ali2
3John1
4Doe2

Expected Output

project_id(INTEGER)average_years(FLOAT)
12
22.5

Tags

EasyBasic SQLJoinsAggregationRoundingMath Functions
10-15 min
72%

Hints