Bird
0
0

Given the table orders with column amount, what will this query return?

medium📝 query result Q13 of 15
SQL - Aggregate Functions
Given the table orders with column amount, what will this query return?
SELECT COUNT(*), MAX(amount), MIN(amount) FROM orders;
ANumber of rows, highest amount, lowest amount
BSum of amounts, average amount, number of rows
COnly the highest amount
DSyntax error due to multiple aggregates
Step-by-Step Solution
Solution:
  1. Step 1: Understand each aggregate

    COUNT(*) counts rows, MAX(amount) finds highest value, MIN(amount) finds lowest value.
  2. Step 2: Combine results

    All three aggregates return one row with three summary values: count, max, and min.
  3. Final Answer:

    Number of rows, highest amount, lowest amount -> Option A
  4. Quick Check:

    COUNT, MAX, MIN = count, max, min [OK]
Quick Trick: Each aggregate returns one summary value in the result [OK]
Common Mistakes:
MISTAKES
  • Confusing COUNT(*) with SUM(amount)
  • Expecting multiple rows instead of one
  • Thinking multiple aggregates cause syntax error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes