Codington
0 of 8 problems solved • 0%

Exercise prompt

Split Each Environment by Status

The same status can appear in several environments. Two grouping columns produce one row for each pair that occurs in the log. The example splits each service ID by status.

Example

SELECT service_id, status, COUNT(*) AS runs FROM deployments GROUP BY service_id, status;

Your task

Count runs for every observed combination of environment and status. Return those two columns followed by run_count. Sort first by environment, then by status, both alphabetically.

Opening the database…