Bird
0
0

Consider these tables:

medium📝 query result Q5 of 15
SQL - INNER JOIN
Consider these tables:
Products(product_id, name)
Sales(product_id, quantity)
What does this query return?
SELECT Products.name, Sales.quantity FROM Products INNER JOIN Sales ON Products.product_id = Sales.product_id WHERE Sales.quantity > 10;
AAll sales including products not sold
BAll products regardless of sales quantity
CSales with quantity less than or equal to 10
DProducts sold with quantity greater than 10
Step-by-Step Solution
Solution:
  1. Step 1: Analyze INNER JOIN and WHERE clause

    INNER JOIN matches products with sales by product_id; WHERE filters sales with quantity > 10.
  2. Step 2: Interpret result

    Only products with sales quantity greater than 10 appear, matching Products sold with quantity greater than 10. Others describe incorrect or unrelated results.
  3. Final Answer:

    Products sold with quantity greater than 10 -> Option D
  4. Quick Check:

    INNER JOIN + WHERE filters matching rows [OK]
Quick Trick: WHERE filters after INNER JOIN matches rows [OK]
Common Mistakes:
MISTAKES
  • Ignoring WHERE clause effect
  • Assuming all products appear
  • Confusing INNER JOIN with OUTER JOIN

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes