From the course: SQL Essential Training

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

How tables share a relationship, part 1

How tables share a relationship, part 1 - SQL Tutorial

From the course: SQL Essential Training

How tables share a relationship, part 1

- [Instructor] Now, as we mentioned, a join is a command that combines the fields from two or more tables in a relational database. Let's take a look at a very simple example using the invoices table of our WSDA music database. Now, in the browse data tab where we are, if we take a look, we see that this table has nine fields. Each invoice has an identification number known as the invoice ID, and each customer that generated an invoice has an identification number known as the customer ID. Let's say the marketing department of our WSDA music database wants to get to know the customer base a bit better. They ask us for a full list of customer names, first and last names, next to all the invoices generated by that customer. How can we write a query using only the customer table? We would not be able to answer this question in one query using the skills we've learned thus far. Our invoice table doesn't contain the names…

Contents