From the course: SQL Essential Training

Unlock the full course today

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

How tables share a relationship, part 2

How tables share a relationship, part 2 - SQL Tutorial

From the course: SQL Essential Training

How tables share a relationship, part 2

- [Host] Now let's take a closer look at the result that our join has produced. There are a few things that we can observe, now that we've combined the invoice table to the customer table. Now, if we take a look at the invoice ID field from the invoice section of the results set, we can see that the first seven records are linked to the same customer. This is customer id number one. This link tells us that customer id number one is responsible for generating all seven of these invoices. If we scroll over to the customer portion of our result, we can tell who customer id number one is. And in this case, it's Mr. Lewis G. One customer is linked to many invoices. In the language of relational databases, we can say that the customer table has a one to many relationship with the invoice table. Now this makes sense when you think about it, seeing that a single customer can generate many invoices simply by purchasing multiple…

Contents