Joining Tables
Joins are a fundamental aspect of relational databases. They allow you to extract data on entities related by design—represented by related tables—in your database.
A join occurs when you retrieve data from tables related by some shared data, often (but not necessarily) a shared reference number or index. For example, if you have a table of customers and a table of orders, good design in a relational database will ensure that the two are related together by some common data between the tables, perhaps by storing a customer number on every order record. By performing a join, you can retrieve information in a resultset where each row combines data from both tables: information about each order will be combined with information about ...
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.