all problems

Count charges by status

sqleasyGROUP BYCOUNT

Return each charge status and the number of charges with that status (as count). Sort by count descending, then status ascending.

hint ladder

query.sql
loading editor…
step inspector

Write a query with WITH … AS (…) blocks, then inspect each intermediate table before the final SELECT.

output

Run your code to see its output, or check your solution to grade it.

Reference solution

The shape we check against. Compare it with your query: the set of rows matters, the formatting does not.

SELECT status, COUNT(*) AS count FROM charges GROUP BY status ORDER BY count DESC, status;

Code is blurred until you solve this problem — the reasoning stays readable.