Bird
0
0

What result does this query produce?

medium📝 query result Q5 of 15
SQL - Subqueries
What result does this query produce?
SELECT product_name FROM products WHERE price < (SELECT AVG(price) FROM products)
AProducts priced above the average price
BProducts priced below the average price
CAll products regardless of price
DSyntax error due to missing parentheses
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the subquery

    The subquery calculates the average price of all products.
  2. Step 2: Analyze the main query condition

    The main query selects products with price less than the average price from the subquery.
  3. Final Answer:

    Products priced below the average price -> Option B
  4. Quick Check:

    Subquery returns average, main query filters below average [OK]
Quick Trick: Use subqueries to compare values like averages [OK]
Common Mistakes:
MISTAKES
  • Confusing less than with greater than
  • Assuming syntax error without checking parentheses
  • Thinking it returns all products

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes