Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLpivot conditional aggregationSingle-choice MCQ

You pivot order counts per region into columns. For a region that had zero 'shipped' orders, what value appears in the shipped column?

SELECT region, COUNT(CASE WHEN status = 'shipped' THEN 1 END) AS shipped, COUNT(CASE WHEN status = 'pending' THEN 1 END) AS pending FROM orders GROUP BY region;