Chapter 6
Complex Query Design
IN THIS CHAPTER
Defining subqueries
Discovering how subqueries work
Nesting subqueries
Tuning nested subqueries
Tuning correlation subqueries
Using relational operators
Relational databases have multiple tables. That’s where the word relational comes from — multiple tables that relate to each other in some way. One consequence of the distribution of data across multiple tables is that most queries need to pull data from more than one of them. There are a couple of ways to do this. One is to use relational operators, and the other method is to use subqueries. This chapter covers both methods.
In some cases, you may find that using the JOIN
operator makes more sense. This operator is considerably more flexible than the relational operators covered in this chapter. Book 4, Chapter 7 covers the various joins and their operations.
What Is a Subquery?
Get Data Analytics & Visualization All-in-One For Dummies now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.