Chapter 12

Delving Deep with Nested Queries

IN THIS CHAPTER

Bullet Pulling data from multiple tables with a single SQL statement

Bullet Comparing a value from one table with a set of values from another table

Bullet Using the SELECT statement to compare a value from one table with a single value from another table

Bullet Comparing a value from one table with all the corresponding values in another table

Bullet Making queries that correlate rows in one table with corresponding rows in another table

Bullet Determining which rows to update, delete, or insert by using a subquery

One of the best ways to protect your data’s integrity is to avoid modification anomalies (see Chapter 5 for the gory details of those) by normalizing your database. Normalization involves breaking up a single table into multiple tables, each of which has a single theme. You don’t want product information in the same table with customer information, for ...

Get SQL For Dummies, 9th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.