Interview Query

Employee Project Budgets

Start Timer

0:00:00

Upvote
26
Downvote
Save question
Mark as completed
View comments (41)
Next question

We’re given two tables. One is named projects and the other maps employees to the projects they’re working on.

Write a query to get the top five most expensive projects by budget to employee count ratio.

Note: Exclude projects with 0 employees. Assume each employee works on only one project.

projects table

Column Type
id INTEGER
title VARCHAR
state_date DATETIME
end_date DATETIME
budget INTEGER

employee_projects table

Column Type
project_id INTEGER
employee_id INTEGER

Output:

Column Type
title VARCHAR
budget_per_employee INTEGER
.
.
.
.
.


Comments

Loading comments