22.1. SQL Part 4 - Subqueries, UNION, INTERSECT, EXCEPT

Read the following articles:

22.1.3. Correlated Subqueries

  1. SQL Correlated Subqueries.

22.1.4. Check Your Understanding

Question

Every statement that uses a subquery can be re-written as a JOIN.

  1. True

  2. False

Question

A subquery cannot use ORDER BY, but the main query can.

  1. True

  2. False

Question

Match the operator to the result set:

INTERSECT

Combined rows from both queries.

EXCEPT

Only keeps rows in common with both queries.

UNION

Keeps rows from left query that aren’t in common with right query.

Question

UNION combines columns and JOINS combine rows.

  1. True

  2. False

Question

What is the difference between a correlated subquery and a nested subquery?