Summary

Today you saw two important and related concepts in relational database design, and learned how to apply them using MySQL.

You saw how to join tables when retrieving data, the resulting data set cross-referencing rows between tables. You saw several kinds of join operations, with the INNER JOIN and LEFT JOIN being of greatest interest.

You also learned how to apply indexes. It should be clear by now that it's always a good idea to consider using indexes, an aspect of database design that is sometimes overlooked. A database will work without indexes—to a point—but it is unlikely to reach its best possible performance without them. They will usually speed up both straightforward SELECTs and joins.

You can now apply the four kinds of indexes ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition 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.