2.16 Join Introduction

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
7 hours 36 minutes
Difficulty
Beginner
CEU/CPE
3
Video Transcription
00:00
I welcome back to module to databases. This is less than four sequel joints were at sub lesson one point to join introduction.
00:07
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.
00:18
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
00:37
and this example,
00:39
I'm going to take to pseudo tables and
00:42
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
00:54
that represents a
00:56
a new table of data. So, for example, if we perform an inter join on these two tables,
01:02
we will get to results back and the and the reason we'll get to records back
01:07
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
01:23
dot car I d equals cars dot idee.
01:27
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
01:38
are the only car ideas that are common in both tables. Now, if we took a right out of joint,
01:45
would actually get
01:47
four records back,
01:49
so we would get a record back for every car that existed and
01:55
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
02:04
these two have no lot.
02:06
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
02:15
and then they left out or join.
02:16
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
02:24
for the left out of joint.
02:27
Now you can reverse those, and this can get confusing
02:30
at first.
02:31
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,
02:50
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,
02:55
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.
03:10
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,
03:29
and we are going to take a look at all those ways
03:31
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.
Up Next