Chapter 6

Complex Query Design

IN THIS CHAPTER

Bullet Defining subqueries

Bullet Discovering how subqueries work

Bullet Nesting subqueries

Bullet Tuning nested subqueries

Bullet Tuning correlation subqueries

Bullet 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.