Bird
0
0

Which of the following SQL queries correctly combines COUNT and AVG aggregates on a table named sales?

easy📝 Syntax Q3 of 15
SQL - Aggregate Functions
Which of the following SQL queries correctly combines COUNT and AVG aggregates on a table named sales?
ASELECT COUNT(*), AVG(amount) FROM sales;
BSELECT COUNT(*), AVG(amount) sales;
CSELECT COUNT(*), AVG(amount) WHERE sales;
DSELECT COUNT(*), AVG(amount) FROM;
Step-by-Step Solution
Solution:
  1. Step 1: Check basic SELECT syntax

    Correct syntax requires SELECT, aggregates, and FROM table name.
  2. Step 2: Validate each option

    SELECT COUNT(*), AVG(amount) FROM sales; has correct syntax; others miss FROM or have wrong clauses.
  3. Final Answer:

    SELECT COUNT(*), AVG(amount) FROM sales; -> Option A
  4. Quick Check:

    Correct aggregate syntax = SELECT COUNT(*), AVG(amount) FROM sales; [OK]
Quick Trick: Always include FROM table after aggregates [OK]
Common Mistakes:
MISTAKES
  • Omitting FROM clause
  • Using WHERE without condition
  • Incorrect clause order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes