1
00:00:00,240 --> 00:00:00,660
All right.

2
00:00:00,660 --> 00:00:07,290
So we're going to start off by taking a bit of a step back and talking about two very high level general

3
00:00:07,290 --> 00:00:11,490
questions that are pretty central to everything this course is about.

4
00:00:11,880 --> 00:00:12,880
And they are.

5
00:00:12,900 --> 00:00:15,240
First off, what is database?

6
00:00:15,480 --> 00:00:19,860
It seems like a pretty straightforward question, but there is a little bit of terminology we need to

7
00:00:19,860 --> 00:00:20,610
discuss.

8
00:00:21,810 --> 00:00:24,030
And then secondly, why do they matter?

9
00:00:24,660 --> 00:00:26,300
So let's start off with the first one.

10
00:00:26,310 --> 00:00:27,390
What is a database?

11
00:00:27,390 --> 00:00:30,300
What actually makes something database?

12
00:00:30,300 --> 00:00:33,680
And there are a couple of definitions that we could go with here.

13
00:00:33,690 --> 00:00:37,200
I kind of synthesized some of them into my own definition.

14
00:00:37,200 --> 00:00:38,390
That has two parts.

15
00:00:38,430 --> 00:00:44,700
And the first part is that it's a collection of data which seems pretty straightforward.

16
00:00:45,120 --> 00:00:51,030
There are all sorts of collections of data around us in the real world, things like when you go to

17
00:00:51,030 --> 00:00:57,840
your doctor's office and there's a filing cabinet full of medical records or even just a to do list

18
00:00:57,840 --> 00:01:04,260
or a list of things to buy at the grocery store qualifies as a collection of data or going back a little

19
00:01:04,260 --> 00:01:11,100
bit in time, if you remember what Rolodexes were, a Rolodex full of different people's contact information

20
00:01:11,190 --> 00:01:14,280
that qualifies as a database under this definition.

21
00:01:14,580 --> 00:01:21,810
Speaking of archaic technology like a Rolodex, another example of a database is a phone book.

22
00:01:22,650 --> 00:01:28,830
So I say this mainly jokingly, but I actually have some siblings who don't know what a phone book is,

23
00:01:28,830 --> 00:01:30,930
or they've never seen one or used one before.

24
00:01:30,930 --> 00:01:36,570
It's a gigantic book basically, that lets you look up people's phone numbers based off of their name.

25
00:01:36,930 --> 00:01:40,890
So it's usually organized by last name alphabetically for people.

26
00:01:40,890 --> 00:01:45,120
So you would flip through the book until you find someone's last name and then you would try and match

27
00:01:45,120 --> 00:01:47,310
the first name and then you find their phone number.

28
00:01:47,310 --> 00:01:49,590
So let's take a quick example here.

29
00:01:49,590 --> 00:01:51,620
This is a fictional phone book.

30
00:01:51,630 --> 00:01:56,610
Think of it as just a little section of a phone book that has tens of thousands of entries.

31
00:01:56,910 --> 00:02:00,960
And these are fictional characters alphabetically organized by their last name.

32
00:02:00,960 --> 00:02:06,060
So Archie Andrews becomes before Betty Cooper, who comes before Ned Flanders and so on.

33
00:02:06,360 --> 00:02:08,639
And then we have corresponding phone numbers.

34
00:02:09,360 --> 00:02:14,100
So imagine you have a gigantic phone book with this information in it, and I ask you to do something

35
00:02:14,100 --> 00:02:16,800
like find Ned Flanders phone number.

36
00:02:17,530 --> 00:02:19,600
Well, it's actually pretty straightforward.

37
00:02:19,630 --> 00:02:23,620
As long as you're comfortable using the alphabet in alphabetical order.

38
00:02:23,650 --> 00:02:28,720
You flip through the book until you find f, f, l, and so on, until you find Ned Flanders.

39
00:02:28,720 --> 00:02:30,190
And then you find his phone number.

40
00:02:30,580 --> 00:02:32,290
It's what the phone book is made for.

41
00:02:32,800 --> 00:02:36,960
However, it gets a little trickier or a lot trickier, really.

42
00:02:36,970 --> 00:02:41,920
If I asked you to do something like find everyone in the phone book who has the first name Ned.

43
00:02:42,610 --> 00:02:44,590
There isn't an easy way to do this.

44
00:02:45,520 --> 00:02:50,680
You basically would have to go through every entry in the book and check for however many thousands

45
00:02:50,680 --> 00:02:51,310
there are.

46
00:02:51,340 --> 00:02:53,260
Is this person's name Ned?

47
00:02:54,730 --> 00:02:58,720
So I have a couple other questions that are similarly difficult.

48
00:02:58,720 --> 00:03:04,270
So the point here is just if you were to find all phone numbers with a particular area code or to find

49
00:03:04,270 --> 00:03:07,840
all people who have a three letter first name, it's not easy.

50
00:03:08,020 --> 00:03:10,720
And it would take a lot of time, a ton of time.

51
00:03:11,650 --> 00:03:17,980
So that brings me to the next component of the definition of what makes something a database, in my

52
00:03:17,980 --> 00:03:24,970
opinion, which is not just a collection of data, it also contains a method for accessing and manipulating

53
00:03:24,970 --> 00:03:25,630
that data.

54
00:03:26,230 --> 00:03:32,560
So going back to this phone book, we would want a way, some sort of program or code that would allow

55
00:03:32,560 --> 00:03:38,110
us to do things like find everybody with the first name Ned or find all people who have a three letter,

56
00:03:38,110 --> 00:03:46,000
first name, or even do things like add a new person into the phonebook or change area codes or change

57
00:03:46,000 --> 00:03:50,620
phone numbers or get crazy and just delete people from our phone book or delete everybody.

58
00:03:50,620 --> 00:03:56,860
If we wanted to, we would have some sort of program or code as part of our database that would help

59
00:03:56,860 --> 00:03:59,950
with that, that would allow us to interface with the data.

60
00:04:00,640 --> 00:04:05,110
So I did say we were going to dive a little bit into jargon and terminology.

61
00:04:05,290 --> 00:04:09,250
I usually try and stay away from that early on while I try and stay away from that in general, but

62
00:04:09,250 --> 00:04:10,870
especially early on in the course.

63
00:04:11,470 --> 00:04:17,260
Basically, if you've read about databases, if you've used one before, if you've read a blog post

64
00:04:17,260 --> 00:04:23,620
about them, you may have come across the term database management system or relational database management

65
00:04:23,620 --> 00:04:28,930
system or DMS or RB, DMS and all these different acronyms.

66
00:04:29,320 --> 00:04:36,130
Basically this right here, what I have on the screen database versus database management system refers

67
00:04:36,130 --> 00:04:42,280
to the fact that what I just talked about having data, a collection of data and then having an interface

68
00:04:42,280 --> 00:04:45,280
for that data are two different things.

69
00:04:45,280 --> 00:04:46,930
So let me show you a quick example.

70
00:04:47,890 --> 00:04:50,290
Imagine that you have an application.

71
00:04:50,500 --> 00:04:57,400
Let's say it is a dating app and then you have a database and you're storing all sorts of information,

72
00:04:57,400 --> 00:05:02,920
all the different users, all the different messages that have been sent, the photos, whatever else

73
00:05:02,920 --> 00:05:04,090
goes into your dating app.

74
00:05:04,090 --> 00:05:08,400
But on its own, the database here is basically like our phonebook.

75
00:05:08,410 --> 00:05:15,310
It's a gigantic collection of data, which is great for storing data, but it really doesn't let us

76
00:05:15,310 --> 00:05:16,170
do very much.

77
00:05:16,180 --> 00:05:19,870
You can almost think of it as if it was a gigantic file on your computer.

78
00:05:19,870 --> 00:05:28,120
So for our application to be able to do things like update somebody's username in the database or edit

79
00:05:28,120 --> 00:05:34,660
their profile photo or delete a user if they want to leave our application, whatever it is, there's

80
00:05:34,660 --> 00:05:39,160
a database management system that allows us to interface with that database.

81
00:05:39,160 --> 00:05:43,810
So it's just the code or the program that does the talking to our database for us.

82
00:05:43,810 --> 00:05:47,980
So we talk to our database management system and it talks to the database.

83
00:05:48,370 --> 00:05:48,790
Okay.

84
00:05:48,790 --> 00:05:51,640
So for the most part, we're out of the weeds with the jargon here.

85
00:05:52,150 --> 00:05:58,960
The reason I brought this up, though, is that oftentimes when people talk about a database, you actually

86
00:05:58,960 --> 00:06:04,360
hear them referring to both of these things, the database management system and the database together

87
00:06:04,480 --> 00:06:07,000
just as a database.

88
00:06:07,450 --> 00:06:12,220
So what I have right here is a list of some of the more common databases you'll run into.

89
00:06:12,460 --> 00:06:19,060
And actually, I just did it there when I was just talking about these four things PostgreSQL, my SQL,

90
00:06:19,090 --> 00:06:20,710
Oracle SQL Light.

91
00:06:20,710 --> 00:06:25,480
They're not technically databases, they're actually database management systems.

92
00:06:25,720 --> 00:06:29,200
But for the most part, people just call them databases.

93
00:06:29,200 --> 00:06:34,750
So when we say things like my SQL is one of the most commonly used databases, it's actually one of

94
00:06:34,750 --> 00:06:37,660
the most commonly used database management systems.

95
00:06:37,780 --> 00:06:40,210
So it's not the end of the world if you forget about that.

96
00:06:40,210 --> 00:06:45,220
But it is important because it will help you understand later on when we actually start talking about

97
00:06:45,220 --> 00:06:50,980
SQL, when we start talking about some of the code that you write to interact with the database, I

98
00:06:50,980 --> 00:06:55,750
think it will help you understand what you're doing and that you're giving commands to this database

99
00:06:55,750 --> 00:07:01,360
management system, which then goes and gives commands to the actual data itself or to the database

100
00:07:01,360 --> 00:07:02,020
itself.

101
00:07:04,300 --> 00:07:08,410
So to wrap everything up, here's a little bit of a synthesized definition.

102
00:07:09,470 --> 00:07:10,490
What is the database?

103
00:07:10,520 --> 00:07:16,040
Well, it's a structured set of computerized data with an accessible interface.

