SQL Subquery Basics Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By ProProfs AI
P
ProProfs AI
Community Contributor
Quizzes Created: 81 | Total Attempts: 817
| Questions: 15 | Updated: May 1, 2026
Please wait...
Question 1 / 16
🏆 Rank #--
0 %
0/100
Score 0/100

1. What is the primary purpose of an INNER JOIN in SQL?

Explanation

An INNER JOIN in SQL is used to combine rows from two or more tables based on a related column between them. It returns only those rows where the specified join condition holds true, effectively filtering out any non-matching entries and ensuring that the result set contains only relevant data from both tables.

Submit
Please wait...
About This Quiz
SQL Subquery Basics Quiz - Quiz

Test your understanding of SQL joins and subqueries with this SQL Subquery Basics Quiz designed for college-level learners. This quiz covers essential concepts including INNER, LEFT, and RIGHT joins, correlated subqueries, and scalar subqueries. Master the skills needed to write efficient database queries that combine data from multiple tables and... see moreuse nested SELECT statements effectively. see less

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. Which join type returns all rows from the left table and matching rows from the right table?

Explanation

A LEFT JOIN retrieves all records from the left table, ensuring that every row is included in the result set. When there are matching rows in the right table, those are included; if there are no matches, NULL values are returned for the right table's columns. This join is useful for preserving all data from the left table.

Submit

3. A subquery that references columns from the outer query is called a ______ subquery.

Explanation

A correlated subquery is one that depends on the outer query for its values. Unlike a regular subquery that can be executed independently, a correlated subquery is evaluated repeatedly, once for each row processed by the outer query, allowing it to reference and use columns from the outer query in its condition.

Submit

4. What is a scalar subquery?

Explanation

A scalar subquery is designed to return a single value, specifically one row and one column. This type of subquery is often used in SQL statements where a single value is needed for comparison or assignment, making it distinct from other subqueries that may return multiple rows or columns.

Submit

5. In which SQL clause can you most commonly place a subquery?

Explanation

Subqueries can be utilized in multiple SQL clauses, primarily in the WHERE, FROM, and SELECT clauses. In the WHERE clause, they filter results based on conditions; in the FROM clause, they can define a dataset; and in the SELECT clause, they can derive values for the output. This versatility allows for complex queries and data manipulation.

Submit

6. A subquery that appears in the WHERE clause and returns multiple rows is often used with the ______ operator.

Explanation

A subquery in the WHERE clause that returns multiple rows is commonly paired with the IN operator. This allows for filtering results based on whether a value matches any value within the set returned by the subquery, effectively enabling more complex conditions in SQL queries.

Submit

7. True or False: A LEFT JOIN includes all rows from the right table, even if there are no matches in the left table.

Explanation

A LEFT JOIN retrieves all rows from the left table and only the matching rows from the right table. If there are no matches in the left table, the right table's rows are not included. Thus, the statement is false, as it incorrectly suggests that all rows from the right table are included regardless of matches.

Submit

8. What does a RIGHT JOIN return?

Explanation

A RIGHT JOIN returns all rows from the right table, ensuring that every entry is included in the result set. For those rows that have corresponding matches in the left table, the related data is also included. If there is no match, the result will show NULL values for columns from the left table.

Submit

9. Which keyword is used to compare a value against the result of a scalar subquery in the WHERE clause?

Explanation

In SQL, comparison operators such as = and > are used to directly compare a value with the result of a scalar subquery. These operators evaluate the outcome of the subquery and allow for conditional filtering in the WHERE clause, enabling precise data retrieval based on specific criteria.

Submit

10. A subquery in the FROM clause is often called a ______ or derived table.

Explanation

A subquery in the FROM clause is referred to as a view or derived table because it allows you to create a temporary result set that can be treated like a table. This enables complex queries to be simplified by breaking them into manageable parts, enhancing readability and maintainability of SQL statements.

Submit

11. True or False: A correlated subquery executes once for each row processed by the outer query.

Explanation

A correlated subquery depends on the outer query for its values, meaning it must be executed repeatedly—once for each row processed by the outer query. This relationship allows the subquery to return results that are specific to the current row being evaluated, thus affirming the statement as true.

Submit

12. What is the difference between an INNER JOIN and a LEFT OUTER JOIN?

Explanation

An INNER JOIN retrieves only the rows that have matching values in both tables, excluding any non-matching entries. In contrast, a LEFT OUTER JOIN returns all rows from the left table, including those without matches in the right table, filling in with NULLs where necessary. This allows for a more comprehensive view of the left table's data.

Submit

13. The EXISTS operator in SQL is used to check whether a subquery returns any ______.

Submit

14. Which of the following is true about a non-correlated subquery?

Submit

15. True or False: You can use a FULL OUTER JOIN in SQL to combine all rows from both tables, including non-matching rows.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (15)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What is the primary purpose of an INNER JOIN in SQL?
Which join type returns all rows from the left table and matching rows...
A subquery that references columns from the outer query is called a...
What is a scalar subquery?
In which SQL clause can you most commonly place a subquery?
A subquery that appears in the WHERE clause and returns multiple rows...
True or False: A LEFT JOIN includes all rows from the right table,...
What does a RIGHT JOIN return?
Which keyword is used to compare a value against the result of a...
A subquery in the FROM clause is often called a ______ or derived...
True or False: A correlated subquery executes once for each row...
What is the difference between an INNER JOIN and a LEFT OUTER JOIN?
The EXISTS operator in SQL is used to check whether a subquery returns...
Which of the following is true about a non-correlated subquery?
True or False: You can use a FULL OUTER JOIN in SQL to combine all...
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!