Recall & Review
beginner
What is a subquery in SQL?
A subquery is a query written inside another query. It helps to get data that will be used by the main query.
Click to reveal answer
beginner
How does a nested query differ from a simple query?
A nested query is a query inside another query, while a simple query stands alone without any inner queries.
Click to reveal answer
intermediate
Can subqueries return multiple rows or columns?
Yes, subqueries can return one or many rows and columns depending on how they are written and used.
Click to reveal answer
intermediate
Where can subqueries be used in SQL statements?
Subqueries can be used in SELECT, WHERE, FROM, and HAVING clauses to filter, calculate, or join data.
Click to reveal answer
advanced
What is the difference between correlated and non-correlated subqueries?
A correlated subquery depends on the outer query for its values and runs once per row, while a non-correlated subquery runs independently once.
Click to reveal answer
What is a subquery in SQL?
✗ Incorrect
A subquery is a query written inside another query to help filter or calculate data.
Where can subqueries be used in SQL?
✗ Incorrect
Subqueries can be used in multiple clauses like SELECT, WHERE, FROM, and HAVING.
What does a correlated subquery depend on?
✗ Incorrect
A correlated subquery uses values from the outer query and runs once per row.
Can subqueries return multiple rows?
✗ Incorrect
Subqueries can return one or many rows depending on their design.
What is a nested query?
✗ Incorrect
A nested query is simply a query inside another query.
Explain what a subquery is and give an example of where it might be used.
Think about how one query can help another by providing data.
You got /2 concepts.
Describe the difference between correlated and non-correlated subqueries.
Consider if the subquery depends on the outer query or not.
You got /3 concepts.