Recall & Review
beginner
What is a subquery in SQL?
A subquery is a query nested inside another query. It runs first and its result is used by the outer query.
Click to reveal answer
beginner
Why do subqueries nest queries?
Subqueries nest queries to break complex problems into smaller steps. The inner query finds data that the outer query uses.
Click to reveal answer
beginner
How does nesting queries help in real life?
Nesting queries helps when you want to filter data based on results from another query, like finding customers who bought a specific product.
Click to reveal answer
intermediate
Can subqueries return multiple rows?
Yes, subqueries can return multiple rows or a single value depending on how they are written and used.
Click to reveal answer
intermediate
What is the order of execution when using subqueries?
The inner subquery runs first to produce results. Then the outer query uses those results to complete the final output.
Click to reveal answer
What does a subquery do in SQL?
✗ Incorrect
A subquery runs inside another query and its result is used by the outer query.
Why do we use nested queries?
✗ Incorrect
Nested queries help by breaking complex problems into smaller, manageable steps.
Which runs first in a nested query?
✗ Incorrect
The inner subquery runs first to provide data for the outer query.
Can a subquery return multiple rows?
✗ Incorrect
Subqueries can return one or many rows depending on how they are written.
What is a real-life example of using a subquery?
✗ Incorrect
Subqueries help find data like customers who bought a specific product by nesting queries.
Explain why subqueries are used to nest queries in SQL.
Think about how breaking a big task into smaller steps helps.
You got /4 concepts.
Describe a simple real-life scenario where nesting queries with subqueries is helpful.
Imagine you want to find people who did something specific.
You got /4 concepts.