Codington
0 of 8 problems solved • 0%

Exercise prompt

Count Deployments by Environment

COUNT(*) gives one count for the whole log. GROUP BY repeats that calculation for each distinct value of a column. The example counts runs with the same status. ORDER BY controls the order in which the groups appear.

Example

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

Your task

Show one row per environment with the environment first and its number of runs as deployment_count. Sort the environments alphabetically.

Opening the database…