7 hours 36 minutes
I welcome back to module to databases. This is less than four sequel joints were at sub lesson one point to join introduction.
Now, as we've touched on briefly and previous tutorials, we've discussed how you can have 1 to 1 relationship. One too many relationship, many too many relationships.
And what ends up occurring is you have all these different tables with these different data sets within a database that you need to occasionally talk to to either update data and start data or very commonly, report on and generate data based on a user's interest in that data
and this example,
I'm going to take to pseudo tables and
and the spreadsheets and show you the concept of a joint. Now the concept of the joint is really simple. Its creator create a relationship between the two tables to create one data set
that represents a
a new table of data. So, for example, if we perform an inter join on these two tables,
we will get to results back and the and the reason we'll get to records back
is because with an inner join, the connecting record or the connecting relationship must exist in both tables so if we took these two tables and joined them on the car, I d. So we put sales a lot
dot car I d equals cars dot idee.
We would get the records three and four back for the cars and the records one and two back for the sales lot. And that would be because three and four
are the only car ideas that are common in both tables. Now, if we took a right out of joint,
would actually get
four records back,
so we would get a record back for every car that existed and
in the fields of the lot, I d would actually get Noel or nothing. The database would say You have off all these cars, but
these two have no lot.
So no is the answer for that and you'll see what I mean when we get to the next tutorial, we actually demo some of these joints
and then they left out or join.
We would get to records back because there's only two items in the sales a lot, but we would get every record back that was in there
for the left out of joint.
Now you can reverse those, and this can get confusing
If you reversed it and you list the tables differently, you could reverse it. Whereas previously the right is now the same as the left on the left was the same as the right. It kind of depends on your perspective when formulating that join. So, for example,
if I use a left outer join between these tables, that's the same is using a right out of joint. If I had him arranged like this,
so just something to keep in mind because it can get a little bit confusing when looking at craze that are built using perhaps the opposites, that vantage point that you might have thought off when connecting those two tables.
So to recap on this introduction to sequel joins, lesson is that as join is a way to form a relationship between two or more tables to define the data set that you want the sequel database engine to return to you. And there's various ways to accomplish that,
and we are going to take a look at all those ways
and the following lesson for sequel joints. So I hope you enjoy this lesson. I hope I was able to introduce you to the concept of joins and I will see you in the next lesson. Thank you.