Loading...

The Severity Matrix

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

Domain
SQL
Difficulty
medium

Problem

Per svc_name in alert_events, pivot counts by severity: critical_count (severity='critical'), warning_count, info_count, null_count (severity IS NULL), and total_count = COUNT(*). Return 6 columns sorted by total_count descending, tie-break alphabetically by svc_name.

Practice This Problem

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