O'Reilly logo

Sams Teach Yourself SQL in 24 Hours, Fifth Edition by Arie D. Jones, Ron D. Plew, Ryan Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hour 14. Using Subqueries to Define Unknown Data

What You’ll Learn in This Hour:

What a subquery is

The justifications of using subqueries

Examples of subqueries in regular database queries

Using subqueries with data manipulation commands

Embedded subqueries

In this hour, you are introduced to the concept of subqueries. Using subqueries enables you to more easily preform complex queries.

What Is a Subquery?

A subquery, also known as a nested query, is a query embedded within the WHERE clause of another query to further restrict data returned by the query. A subquery returns data that is used in the main query as a condition to further restrict the data to be retrieved. Subqueries are employed with the SELECT, INSERT, UPDATE, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required