menu
Clear Progress
Home
Easy
Basic SELECT Query
Filtering Data with WHERE Clauses
Sorting Data with ORDER BY
Using Aggregate Functions
Grouping Data with GROUP BY
Filtering Groups with HAVING
Joining Tables (INNER JOIN)
LEFT JOIN and NULL Handling
Combining Results with UNION
Medium
Subqueries for Complex Filtering
Using CASE Statements
Grouping Data with GROUP BY
Description:
Explore grouping data and using aggregate functions within groups. Retrieve the average salary by department.
Table Used:
employees
Columns:
employee_id
,
first_name
,
last_name
,
department
,
salary
Expected Columns Returned:
department
,
average_salary
Schema:
classDiagram direction BT class Employees { integer employee_id text first_name text last_name text department float salary }
select * from employees
Run
Clear
Solution