Skip to content
Theory · Subqueries · lesson 3 of 11

IN and EXISTS

A scalar subquery brings back one number. But often you need a whole list: for example, the numbers of the customers who ordered at the Lenin Avenue shop. The numbers live in the orders table, and the names in customers.

In this lesson

  • IN with a list from a subquery
  • EXISTS: is there at least one row
  • Common mistake
  • Key points