CTEs1 / 4
EASY·Output prediction

Given this table (orders): | id | customer | amount | |----|----------|--------| | 1 | Alice | 100 | | 2 | Bob | 200 | | 3 | Alice | 300 | What does this query return?

WITH totals AS (
  SELECT customer, SUM(amount) AS total
  FROM orders
  GROUP BY customer
)
SELECT customer FROM totals WHERE total > 200;

Sign in to save your progress.