Ctr

Group by Department

We're still working at devils.fyi, a website similar to levels.fyi.

Students have started show interest in the site! They use our data to help pick their areas of study. However, they care more about salary information for departments than specific companies. Luckily, we have department in our employees table too.


employees
column_name type
id
INTEGER
name
VARCHAR
company
VARCHAR
department
VARCHAR
job_title
VARCHAR
salary
INTEGER
start_date
DATE

Select each department, and its average salary (name that column avg_salary).

© 2022 Andrew Carlson. All rights reserved.

department
VARCHAR
avg_salary
NUMERIC
1
Functionality
187333.333333333333
2
Research
145000.000000000000
3
Infrastructure
167000.000000000000
4
Marketing
173300.000000000000
5
Quality
146750.000000000000
6
Solutions
154666.666666666667
7
Integration
157200.000000000000
7 rows

You haven't solved this challenge yet!
Are you sure you want to reveal the answer?