Loading...

Department Quarterly Pivot

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

Domain
SQL
Difficulty
hard
Seniority
mid

Problem

Show employee count broken down by department and fiscal quarter. For each department, create columns Q1 through Q4 showing how many metric entries exist per quarter. If a quarter has no entries, show 0.

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.