The code for GroupByNeedsOrderBy.sql is: SELECT status, COUNT(*) FROM orders GROUP BY #status # Unordered #status DESC; does not work. You need: status ORDER BY status DESC #status DESC ;