1
00:00:02,110 --> 00:00:04,360
Now we did set up the MySQL server

2
00:00:04,360 --> 00:00:05,980
in the last lecture,

3
00:00:05,980 --> 00:00:09,120
and now we are ready to dive into it.

4
00:00:09,120 --> 00:00:11,600
But before we write our queries

5
00:00:11,600 --> 00:00:13,630
and before we create databases,

6
00:00:13,630 --> 00:00:15,610
we have to understand the structure

7
00:00:15,610 --> 00:00:18,370
of the things we just installed

8
00:00:18,370 --> 00:00:20,270
and we'll be working with.

9
00:00:20,270 --> 00:00:21,730
Because what we actually did

10
00:00:21,730 --> 00:00:24,100
is we installed MySQL.

11
00:00:24,100 --> 00:00:27,110
Now that's actually the software itself.

12
00:00:27,110 --> 00:00:29,830
It includes the database server,

13
00:00:29,830 --> 00:00:31,010
which is the thing that will

14
00:00:31,010 --> 00:00:32,970
actually host our databases,

15
00:00:32,970 --> 00:00:34,680
and which is the thing with

16
00:00:34,680 --> 00:00:38,250
which we connect to stored data or fetch data.

17
00:00:38,250 --> 00:00:39,660
And then also for example,

18
00:00:39,660 --> 00:00:42,170
there's MySQL Workbench Tool.

19
00:00:42,170 --> 00:00:43,500
There's UI client,

20
00:00:43,500 --> 00:00:46,913
that's all a part of the MySQL software package.

21
00:00:47,830 --> 00:00:49,600
And it's indeed that server

22
00:00:49,600 --> 00:00:52,470
which we started in the last lecture as well,

23
00:00:52,470 --> 00:00:55,010
which is now running on our local machine

24
00:00:55,010 --> 00:00:56,240
and to which we can connect

25
00:00:56,240 --> 00:00:59,560
to store data there or fetch data.

26
00:00:59,560 --> 00:01:03,740
So this is the actual server that will host our databases

27
00:01:03,740 --> 00:01:05,370
and that's not important.

28
00:01:05,370 --> 00:01:08,930
In the last lectures and in the last section

29
00:01:08,930 --> 00:01:10,420
I often said,

30
00:01:10,420 --> 00:01:12,190
Sequel Database,

31
00:01:12,190 --> 00:01:15,930
when I meant a solution like MySQL.

32
00:01:15,930 --> 00:01:18,980
But actually the concrete databases

33
00:01:18,980 --> 00:01:21,200
are not what we installed.

34
00:01:21,200 --> 00:01:25,260
Instead we installed that server and MySQL Workbench,

35
00:01:25,260 --> 00:01:28,330
but the databases are groupings,

36
00:01:28,330 --> 00:01:32,760
containers that are actually hosted by that server.

37
00:01:32,760 --> 00:01:34,290
So on that server,

38
00:01:34,290 --> 00:01:37,870
we will now be able to create multiple databases,

39
00:01:37,870 --> 00:01:40,340
relational databases by default,

40
00:01:40,340 --> 00:01:41,890
since we're using MySQL

41
00:01:41,890 --> 00:01:45,720
and MySQL is about relational databases.

42
00:01:45,720 --> 00:01:48,280
But it's these concrete databases

43
00:01:48,280 --> 00:01:50,080
with which we'll interact

44
00:01:50,080 --> 00:01:53,100
when we later run our queries and so on.

45
00:01:53,100 --> 00:01:54,870
So we installed MySQL.

46
00:01:54,870 --> 00:01:56,730
That was actually the installation

47
00:01:56,730 --> 00:01:59,130
of a server and MySQL Workbench.

48
00:01:59,130 --> 00:02:00,780
Then we started the server

49
00:02:00,780 --> 00:02:02,020
and then we'll start

50
00:02:02,020 --> 00:02:05,230
and create databases on that server.

51
00:02:05,230 --> 00:02:09,970
And these databases are also sometimes called Schemas.

52
00:02:09,970 --> 00:02:12,190
Here in the MySQL Workbench,

53
00:02:12,190 --> 00:02:15,360
we have this Administration and Schemas tab

54
00:02:15,360 --> 00:02:18,690
and Schemas actually holds all the databases

55
00:02:18,690 --> 00:02:21,200
we have on this database server,

56
00:02:21,200 --> 00:02:23,000
to which we connected here.

57
00:02:23,000 --> 00:02:26,120
And we have one database by default here,

58
00:02:26,120 --> 00:02:28,290
which holds System Information.

59
00:02:28,290 --> 00:02:29,130
As you can see,

60
00:02:29,130 --> 00:02:31,410
it has one table in it.

61
00:02:31,410 --> 00:02:34,400
But we can also add our own databases,

62
00:02:34,400 --> 00:02:37,800
which then can hold our application data.

63
00:02:37,800 --> 00:02:42,060
And then as you just saw in that MySQL Workbench Tool,

64
00:02:42,060 --> 00:02:45,050
every database can have multiple tables

65
00:02:45,050 --> 00:02:46,480
and it's the tables that will

66
00:02:46,480 --> 00:02:49,510
hold the actual data records later.

67
00:02:49,510 --> 00:02:52,460
So it's the tables that have these columns and rows,

68
00:02:52,460 --> 00:02:55,670
and it's the tables that hold the actual data.

69
00:02:55,670 --> 00:02:59,160
But we can have multiple databases with multiple tables

70
00:02:59,160 --> 00:03:01,100
simply depending on what we need

71
00:03:01,100 --> 00:03:03,090
for the website we're building.

72
00:03:03,090 --> 00:03:06,090
For simple websites like the ones we're building here,

73
00:03:06,090 --> 00:03:08,930
you will very often only have one database

74
00:03:08,930 --> 00:03:10,770
on that database server.

75
00:03:10,770 --> 00:03:12,600
But for more complex websites

76
00:03:12,600 --> 00:03:16,210
you could have multiple databases in a single server.

77
00:03:16,210 --> 00:03:17,500
And now that we know that.

78
00:03:17,500 --> 00:03:19,860
Let's start working with MySQL

79
00:03:19,860 --> 00:03:22,220
and let's start creating some databases

80
00:03:22,220 --> 00:03:23,130
and tables

81
00:03:23,130 --> 00:03:23,963
and data.

