logo

Oracle NextGen

score

SQL Challenge

Challenge #5 – Average Salary by Department

Challenge Overview
Calculate the average salary for each department.

Requirements

  • Return columns: department, avg_salary.
  • Group results by department.
  • Round average salary to 2 decimal places.
  • Order by department name alphabetically.
Sample Dataset
Preview the schema and seeded rows you can query against.

employees

Contains employee salary information.

Columns
NameTypeNotes
employee_idINTPrimary key
employee_nameVARCHAREmployee name
departmentVARCHARDepartment
salaryDECIMALAnnual salary
Sample Rows
employee_idemployee_namedepartmentsalary
1JohnSales50000
2JaneEngineering75000
3BobSales55000
4AliceEngineering80000
5CharlieHR60000
SQL Playground
Loading editor…

Result Preview

Awaiting Run

Run your query to see the dataset preview.