1
00:00:00,660 --> 00:00:06,300
Hello, everyone, in the last video, I have shown you how you can create or connect your database

2
00:00:06,300 --> 00:00:07,140
to your program.

3
00:00:07,590 --> 00:00:12,860
No, I will show you how you can create some tables inside this database.

4
00:00:13,350 --> 00:00:16,200
So as you can see here, we have this fine database.

5
00:00:16,200 --> 00:00:22,590
Does DMAE, which is the means that we have created now in this case, if we will run our program,

6
00:00:23,520 --> 00:00:28,410
we won't create another one, but we just connect this database to our program.

7
00:00:29,380 --> 00:00:35,060
Now, as I told you, we want to create some tables inside this database.

8
00:00:35,340 --> 00:00:40,520
For example, if we want that, if we want this database, we want to start on it.

9
00:00:40,740 --> 00:00:47,160
Some users, some users with the first name, first name and last name and age.

10
00:00:47,490 --> 00:00:50,850
So in this case, we have to had a table like this one.

11
00:00:51,240 --> 00:00:57,000
There is three columns, the first for the first name and second for the last name and the third for

12
00:00:57,000 --> 00:00:57,420
the age.

13
00:00:57,840 --> 00:01:05,340
That this was will be the columns of our table and the rows will be the users for, for example, the

14
00:01:05,340 --> 00:01:08,910
user one this one user to this second row.

15
00:01:08,920 --> 00:01:10,500
Exito No.

16
00:01:10,620 --> 00:01:14,220
To do this, the first thing that we have to do is to create a cursor.

17
00:01:14,640 --> 00:01:17,670
This cursor will circulate inside the database.

18
00:01:17,880 --> 00:01:22,120
So we will call it, for example, because we can integrate with another thing.

19
00:01:22,140 --> 00:01:24,510
We have to create a cursor and description.

20
00:01:24,570 --> 00:01:30,740
We create we need, he said, the database to bring something or enter something or create a table.

21
00:01:31,020 --> 00:01:32,710
So we'll use Eggertsson.

22
00:01:33,090 --> 00:01:34,380
So cool.

23
00:01:34,670 --> 00:01:37,110
So we will call it quits.

24
00:01:37,150 --> 00:01:38,820
So now we use it.

25
00:01:39,570 --> 00:01:46,140
We were created using the the function cursor, which is this one.

26
00:01:46,560 --> 00:01:48,480
In this case, we are in this line.

27
00:01:48,480 --> 00:01:49,280
We have created.

28
00:01:49,590 --> 00:01:51,020
So we have created the cursor.

29
00:01:51,030 --> 00:01:58,860
We will make a comment here, for example, create a cursor in this line.

30
00:01:58,860 --> 00:02:00,170
We have created the cursor now.

31
00:02:01,860 --> 00:02:03,390
After that we have created it.

32
00:02:03,750 --> 00:02:08,120
We will use it to create a table inside, inside our database.

33
00:02:08,520 --> 00:02:16,380
So to create it, we have just right here the cursor that I think that you had to use the function executes,

34
00:02:16,380 --> 00:02:21,650
which is this one inside this function will write on what we want to create the table.

35
00:02:21,960 --> 00:02:25,590
So we will write it like a single cell inside the quotation marks.

36
00:02:25,980 --> 00:02:30,570
Here we have two key words, which is the first one is create.

37
00:02:31,590 --> 00:02:35,100
The second one is table, which may create table.

38
00:02:35,760 --> 00:02:39,840
After these two key words, we will write the name of the table that we want.

39
00:02:39,870 --> 00:02:43,310
So, for example, we will call these users our table.

40
00:02:43,320 --> 00:02:44,730
We will give it name user.

41
00:02:44,740 --> 00:02:47,790
So we will have to make this one inside the database.

42
00:02:48,100 --> 00:02:52,440
We have these columns and these lines, which is the user we will.

43
00:02:52,440 --> 00:02:54,620
And after that we enter the users.

44
00:02:54,630 --> 00:02:56,080
We will have these lines for the moment.

45
00:02:56,080 --> 00:02:58,600
You will create just the columns and empty columns.

46
00:02:58,620 --> 00:03:05,550
OK, so we have to write here the name of the user of the table, which is user.

47
00:03:05,630 --> 00:03:12,320
Now we will make these two parenthesis inside the Burgess's realize the different columns that we have.

48
00:03:12,660 --> 00:03:19,140
So we have to write the name of the column, then the type of the data that we will store in that corner.

49
00:03:19,380 --> 00:03:28,380
So the first column we have the first name, so we make its first first name, then we make a space.

50
00:03:28,410 --> 00:03:33,590
After that we realized the type of this of the data that we will store in this column.

51
00:03:33,720 --> 00:03:35,700
In this case, the first name is a string.

52
00:03:35,700 --> 00:03:37,020
So we make a text.

53
00:03:37,470 --> 00:03:40,610
Then we have the last name here.

54
00:03:42,150 --> 00:03:45,750
Sorry, last name is to a text.

55
00:03:45,750 --> 00:03:46,900
So we put it text.

56
00:03:46,920 --> 00:03:53,950
Then we have the age, which is an integral because the age will make it one, two, three extra.

57
00:03:54,180 --> 00:03:55,220
So this is an etiquette.

58
00:03:55,230 --> 00:03:56,820
So we would put it just like this.

59
00:03:57,180 --> 00:04:04,140
So if we on our program now, we will create this table inside the our database.

60
00:04:04,320 --> 00:04:10,110
So as you can see, if we will run it, we have nothing here because this table is already not.

61
00:04:10,260 --> 00:04:12,930
We have created this table in the database.

62
00:04:13,290 --> 00:04:19,200
But if we will create we will run this program another time, we would have probably a why?

63
00:04:19,650 --> 00:04:26,820
Because we have if we create this table inside the space with this name, we can't create another table

64
00:04:26,970 --> 00:04:28,440
with the same name.

65
00:04:28,590 --> 00:04:33,930
Because if we have a folder and we have a file text file, for example, with the name user, we can't

66
00:04:35,010 --> 00:04:40,430
put another another file with the same type, which is text at the same time, the same name.

67
00:04:40,620 --> 00:04:48,960
We can't put two files with the same name and same type inside one folder so we can create two tables

68
00:04:48,960 --> 00:04:51,690
in the same database with the same name.

69
00:04:51,960 --> 00:04:54,660
If we want to create another table, for example, we can create it.

70
00:04:54,990 --> 00:04:59,490
We can create, for example, user I don't know, for example, this one for users, another one for

71
00:04:59,490 --> 00:04:59,870
worker.

72
00:05:00,810 --> 00:05:08,970
But we can't put to the tables in the same database with the same name, if I want to show you, if

73
00:05:08,970 --> 00:05:16,260
we run the program another time, you will see here table or table, the table workers already exist.

74
00:05:16,530 --> 00:05:19,020
So we can't use we can create another one.

75
00:05:19,030 --> 00:05:19,600
We've seen it.

76
00:05:19,620 --> 00:05:23,820
If we want to create another one, we have just to, for example, change the name here.

77
00:05:23,820 --> 00:05:26,750
Every excuse in this case will create another one.

78
00:05:27,030 --> 00:05:31,770
So if we are working in the database, we have to create it.

79
00:05:32,070 --> 00:05:35,660
Just that is just this line, which is a creation of the table.

80
00:05:35,940 --> 00:05:38,040
We will run it just one time after that.

81
00:05:38,040 --> 00:05:41,220
We will make it in a month or we can take it off.

82
00:05:41,220 --> 00:05:48,630
But we have to let it here because if we want to to go to compare our columns, so we have to see it.

83
00:05:48,640 --> 00:05:56,280
So it will be easy, but there is no other way we can put another another file here, just special for

84
00:05:56,280 --> 00:05:57,000
the database.

85
00:05:57,010 --> 00:06:04,410
So in this file, we will just create the database, for example, and we will recreate it and we will

86
00:06:04,410 --> 00:06:12,150
create the tables so we create disobeys and the tables after that in the file of our up or our projects,

87
00:06:12,150 --> 00:06:14,090
we will work with this directly.

88
00:06:14,610 --> 00:06:16,080
So that's was for today.

89
00:06:16,110 --> 00:06:18,770
And I will show you I will see you.

90
00:06:18,870 --> 00:06:21,200
So I will see you in the next video.

91
00:06:21,840 --> 00:06:23,340
So stay safe by.
