Bird
0
0

What will this query return?

medium📝 query result Q5 of 15
SQL - Aggregate Functions
What will this query return?

SELECT COUNT(*) FROM Employees WHERE Department = 'Sales';
ANumber of employees in Sales department
BList of all employees
CSum of employee salaries
DError due to missing GROUP BY
Step-by-Step Solution
Solution:
  1. Step 1: Understand COUNT(*) with WHERE clause

    COUNT(*) counts rows that match the condition Department = 'Sales'.
  2. Step 2: Identify what the query returns

    The query returns a single number: how many employees are in Sales.
  3. Final Answer:

    Number of employees in Sales department -> Option A
  4. Quick Check:

    COUNT(*) with WHERE = filtered row count [OK]
Quick Trick: COUNT(*) counts rows matching conditions [OK]
Common Mistakes:
MISTAKES
  • Confusing COUNT(*) with SUM()
  • Expecting a list instead of a count
  • Thinking GROUP BY is required here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes