A table contains multiple transactions for each account. The analyst needs one row per account with the total transaction amount. Which query pattern is appropriate?

Published
  1. SELECT SUM(amount) FROM transactions
  2. SELECT DISTINCT account_id, amount FROM transactions
  3. SELECT account_id, SUM(amount) FROM transactions GROUP BY account_id
  4. SELECT account_id, amount FROM transactions

Comments — 0