7.Advanced Queries

In this chapter, we'll discuss more advanced queries. Principally, we will look at how we can run queries across multiple tables. This will involve learning about the concept of joins—that is, how we join tables together.

We will cover the following:

• Using joins to run queries over multiple tables, including:

    • Natural, inner, and cross joins

    • Straight joins

    • Left and right joins

• Writing subqueries

• Using SELECT statement options

Using Joins to Run Queries over Multiple Tables

All the queries in Chapter 6, “Querying MySQL,” retrieved data from only a single table. Given that we've focused on a normalized database design in which information is stored in multiple tables, selecting from ...

Get MySQL Tutorial 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.