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
What does a JOIN do in SQL?
A JOIN combines rows from two or more tables based on a related column between them.
Click to reveal answer
intermediate
When might you prefer a JOIN over a subquery?
You might prefer a JOIN when you want to combine data from multiple tables in one result set efficiently.
Click to reveal answer
intermediate
Can subqueries be used in the SELECT, FROM, or WHERE clauses?
Yes, subqueries can appear in SELECT, FROM, or WHERE clauses depending on what you want to achieve.
Click to reveal answer
intermediate
Which is generally faster: JOINs or subqueries?
JOINs are often faster because they let the database optimize how tables are combined, but it depends on the query and indexes.Click to reveal answer
What does a JOIN do in SQL?
✗ Incorrect
A JOIN combines rows from tables based on matching columns.
Where can a subquery NOT be used?
✗ Incorrect
Subqueries are not used in CREATE TABLE statements.
Which is usually more efficient for combining tables?
✗ Incorrect
JOINs are usually more efficient for combining tables.
A subquery is:
✗ Incorrect
A subquery is a query nested inside another query.
Which SQL clause can contain a subquery?
✗ Incorrect
Subqueries can be used in the WHERE clause to filter results.
Explain the main differences between subqueries and JOINs in SQL.
Think about how data is combined and when each is useful.
You got /4 concepts.
Describe a situation where using a JOIN is better than a subquery.
Consider when you want to see related data side by side.
You got /4 concepts.