Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,420 --> 00:00:07,020
So we ended on cardinality and we've looked at a lot of the relational model, we've seen so much of
2
00:00:07,020 --> 00:00:14,400
it, but yet we haven't hit the main point of what makes the relational model the relational model,
3
00:00:14,880 --> 00:00:19,870
and that is the ability to link relationships between different types of data.
4
00:00:20,430 --> 00:00:24,480
If we look over here, we can see something called the primary key.
5
00:00:25,320 --> 00:00:30,480
And so the primary key, in essence, is a key.
6
00:00:31,440 --> 00:00:40,050
Now, you may be thinking, well, yeah, I can read two primary key, but what this is, is something
7
00:00:40,050 --> 00:00:42,440
that uniquely identifies your data.
8
00:00:42,870 --> 00:00:46,620
We've always seen this in most of the tables that I've shown you.
9
00:00:46,620 --> 00:00:53,070
We've seen the ID field there and we've seen it uniquely identify each and every one, two, three,
10
00:00:53,070 --> 00:00:53,970
four, five.
11
00:00:54,480 --> 00:00:59,480
It is a unique identifier, uniquely identifies each and every role.
12
00:00:59,940 --> 00:01:01,420
And why is that important?
13
00:01:01,590 --> 00:01:08,580
Well, uniquely identifying each and every piece of data means that we can now know for certain the
14
00:01:08,580 --> 00:01:11,260
person with I.D. one is mobily.
15
00:01:12,420 --> 00:01:17,160
Now, it's great, I'm number one, I'm not trying to say that, but what I'm trying to say here is
16
00:01:17,160 --> 00:01:25,920
that because of the I.D. being the primary key, primary key being the term that we use to say this
17
00:01:25,920 --> 00:01:30,990
is the thing that's uniquely identifying each and every role because it is the primary, we can now
18
00:01:30,990 --> 00:01:34,770
use it and we can say, well, hey, I have some other data over here.
19
00:01:35,160 --> 00:01:39,210
And it's kind of linked to this is kind of linked to Mobeen.
20
00:01:39,630 --> 00:01:41,300
And so I can use his ID, right?
21
00:01:41,310 --> 00:01:43,880
I can use his I.D. and I can say, oh, this is linked to MCGEENEY.
22
00:01:44,040 --> 00:01:46,310
And yes, you can.
23
00:01:46,860 --> 00:01:52,240
That is the vital part of the relational model, the ability to draw relationships.
24
00:01:52,260 --> 00:01:53,880
And so how would that look?
25
00:01:54,120 --> 00:01:55,110
Well, let me show you.
26
00:01:55,990 --> 00:02:02,620
There is also something called the foreign key, and the foreign key is just this other terminology
27
00:02:02,620 --> 00:02:11,470
for saying, well, if the primary key is uniquely identifying my data in place, if I am going to reference
28
00:02:11,500 --> 00:02:17,980
data from somewhere else, well, I'm going to reference it by that primary key because like I said,
29
00:02:18,190 --> 00:02:20,190
I want to uniquely identify MCGEENEY.
30
00:02:20,440 --> 00:02:21,620
So Mobeen is number one.
31
00:02:21,760 --> 00:02:26,040
Well, if I went into the manager ID, I can see here, M1, M2, M3.
32
00:02:26,230 --> 00:02:32,350
And so if I'm going to link that relationship, if I'm going to say, well, you know what, Clive Bowie
33
00:02:32,350 --> 00:02:36,310
is the manager of Moe, well, then I'm going to have to do that in a certain way.
34
00:02:36,320 --> 00:02:43,620
So we see over here in Orange the manager ID being the primary key of managers and one and two and three.
35
00:02:44,230 --> 00:02:47,050
And so over here we see the primary chemokine one.
36
00:02:47,930 --> 00:02:49,560
And the manager of Mobily.
37
00:02:50,520 --> 00:02:53,980
Is done by drawing a relationship to manage, right?
38
00:02:54,150 --> 00:03:03,150
And the way we do this is by injecting a column, there is a new column in this table in the sole purpose
39
00:03:03,150 --> 00:03:09,510
of this column is to manage that relationship is to say, hey, well, Mo.
40
00:03:10,550 --> 00:03:18,870
Is managed by anyone, so a foreign key references the primary key of a different table.
41
00:03:19,370 --> 00:03:20,510
Let me repeat that again.
42
00:03:21,020 --> 00:03:28,460
A foreign key is a key that will reference the primary key, the unique identifier of a different table,
43
00:03:28,760 --> 00:03:36,440
therefore allowing a relationship to be formed that is solidified in stone, more so than my fiance
44
00:03:36,530 --> 00:03:37,540
and I's marriage.
45
00:03:38,210 --> 00:03:39,380
I'm kidding there, of course.
46
00:03:39,620 --> 00:03:47,300
But that being said, with this, what you basically get is a relationship and a relationship that is
47
00:03:47,300 --> 00:03:53,240
warranted by the fact that is linked to a key and that key is unique.
48
00:03:53,450 --> 00:03:55,520
That key cannot be changed.
49
00:03:55,670 --> 00:04:02,290
That key cannot be deleted because if it is deleted, then it would cause issues throughout the system.
50
00:04:02,870 --> 00:04:04,510
We'll get into that part later.
51
00:04:04,700 --> 00:04:10,370
But that being said, what we need to know now is because we are referencing a unique key and because
52
00:04:10,370 --> 00:04:13,670
we are injecting this column that says Manager Idee.
53
00:04:14,650 --> 00:04:26,650
In the same table as the employees will now we know for certain that Mo, its manager, is Clyde Bowie,
54
00:04:27,070 --> 00:04:29,050
and that is how we link relationships.
55
00:04:29,500 --> 00:04:32,140
We link relationships by primary keys.
56
00:04:32,410 --> 00:04:35,920
And once you've created a relationship, a primary key.
57
00:04:36,720 --> 00:04:39,450
Where it is injected becomes the foreign.
58
00:04:40,600 --> 00:04:48,550
So now that we know all of that, we know the core of the relational model, we know the essence of
59
00:04:48,550 --> 00:04:55,150
why the relational model is the way it is, this unique way of trying relationships is what makes it
60
00:04:55,150 --> 00:04:55,740
special.
61
00:04:56,140 --> 00:04:56,890
Amazing.
62
00:04:57,160 --> 00:04:58,840
Well, now we know the relational model.
63
00:04:58,840 --> 00:05:00,270
Now we know all of this stuff.
64
00:05:00,640 --> 00:05:03,100
Let's look at how these databases can be used.
6704
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.