1
00:00:00,900 --> 00:00:06,330
So far, we worked with retrieving Delta from an existing skull table.

2
00:00:06,570 --> 00:00:12,030
In this video, you learn how to add new rows to an existing school table.

3
00:00:12,450 --> 00:00:18,960
We will use the database to file which you can find the touched in the very first lecture of this section.

4
00:00:19,980 --> 00:00:22,740
We establish a connection and we create a cursor.

5
00:00:24,770 --> 00:00:33,170
Then the next thing you want to do is you want to prepare the new delta and the proper format is least

6
00:00:33,170 --> 00:00:37,910
of tipples, so let's prepare this delta, store them in a variable.

7
00:00:38,210 --> 00:00:40,430
Let's call this new rose.

8
00:00:40,880 --> 00:00:43,370
Let's go to a list of tipples.

9
00:00:44,030 --> 00:00:45,920
So how many rows do you want to add?

10
00:00:46,670 --> 00:00:47,290
Maybe two.

11
00:00:47,300 --> 00:00:54,440
So you have two tables, and in each temple you want to specify the new rules.

12
00:00:54,980 --> 00:01:00,680
So for that, you need to have in in minds the structure of your database table.

13
00:01:01,310 --> 00:01:08,750
So in our case, we have three three columns and multiple rows, so we want to add another row, which

14
00:01:08,750 --> 00:01:10,310
looks something like this.

15
00:01:10,340 --> 00:01:16,220
So an IP address the domain and the asset.

16
00:01:16,220 --> 00:01:22,940
And so the IP address, let's say, hundreds and hundreds and hundreds.

17
00:01:23,340 --> 00:01:28,100
And the domain a b that C, for example.

18
00:01:28,100 --> 00:01:32,660
And the ason you can do the same for all the records.

19
00:01:33,230 --> 00:01:35,900
200, 200 200 200.

20
00:01:38,050 --> 00:01:49,270
F the D that e 200, so normally in real life, you could take these dots of room a c as vile, for

21
00:01:49,270 --> 00:01:49,780
example.

22
00:01:51,740 --> 00:01:59,810
And create this list, we have ideas on working with CSC files in the course, so you can find that

23
00:01:59,840 --> 00:02:01,780
information in the previous verse.

24
00:02:02,540 --> 00:02:06,710
But for this example, we can just give them a list already.

25
00:02:07,070 --> 00:02:11,270
And then you apply Kerr that executes many.

26
00:02:13,130 --> 00:02:18,890
Now this expects an actual statement.

27
00:02:19,310 --> 00:02:33,890
Unless a command switches inserts to insert doctor inserts into in to s values and in parentheses,

28
00:02:33,890 --> 00:02:40,160
you see question mark, comma, question mark, comma and another question mark.

29
00:02:40,190 --> 00:02:44,930
So three question marks because we have three columns.

30
00:02:45,800 --> 00:02:52,450
So that is a string that is the first arguments or the methods.

31
00:02:52,850 --> 00:03:00,770
The second argument is the variable, which holds that this data of a new rose, which is new rose.

32
00:03:02,150 --> 00:03:03,350
So like that.

33
00:03:03,920 --> 00:03:11,780
And finally, you should do that commit to commit the changes that will serve the rose.

34
00:03:11,960 --> 00:03:19,130
And if you want to see the final results, then you want to execute another Eskil query, which is the

35
00:03:19,130 --> 00:03:25,880
usual select bowl from the table i as.

36
00:03:27,810 --> 00:03:31,350
And print could fetch all.

37
00:03:33,110 --> 00:03:33,830
And executes.

38
00:03:36,360 --> 00:03:44,520
So what's going to happen is that new rules will be inserted into the table and then we will print out

39
00:03:44,820 --> 00:03:46,890
the entire table.

40
00:03:47,520 --> 00:03:49,080
So that's the results.

41
00:03:49,590 --> 00:03:58,320
You see, we have existing rules in here and here is the new rule and there's the other room as well

42
00:03:58,320 --> 00:03:58,650
here.

43
00:03:59,610 --> 00:04:02,850
So the first one and the second one in here.

44
00:04:03,570 --> 00:04:10,620
So that's how you insert new rules to a database table via Python and ask you light three.

45
00:04:11,430 --> 00:04:13,980
I thank you for folding and see you later.

