Loading...

Department Snapshot

A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
medium

Problem

The HR analytics team is building a department performance summary for the all-hands. For each department, show the lowest recorded metric, the highest, the average, and the spread between the two extremes. Rows with a missing metric has no value on file should be left out of all calculations. Only include departments that have contributed more than five valid readings , a smaller sample isn't reliable enough to surface. Order results from the widest performance spread to the narrowest.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.