$ ./guess_the_languageSQL & Databases
SQL & Databases · easy · #14

How many rows does the result contain?

-- orders.region: 'EU', 'US', 'EU', 'APAC', 'US'
SELECT region, SUM(total)
FROM orders
GROUP BY region;
  1. 2
  2. 1
  3. 3
  4. 5
GROUP BY emits one row per distinct group: EU, US and APAC.
Play SQL & Databases ▸