WEBVTT 00:00.360 --> 00:01.080 Welcome back. 00:01.080 --> 00:05.220 Now in this lecture let us insert values in our database. 00:05.220 --> 00:12.150 So let me come in these as I said we only run CREATE TABLE ones once our database and once our table 00:12.150 --> 00:18.390 is created we just run values to insert and update delete and fetch data. 00:18.630 --> 00:26.100 So let me use my cursor object and then execute method and pass a query to insert in our Employee table. 00:26.490 --> 00:31.310 What I need to pass with my query it would be insert into then my table name. 00:31.410 --> 00:39.030 Then I need to use values and then in trouble we need to pass all the value that I want I would be one 00:39.360 --> 00:44.290 that I need to pass my name salary by department and my position. 00:46.880 --> 00:53.140 Remember there are few important things here I'm taking them as capital just to make them readable. 00:53.180 --> 00:55.290 You can take them in small later. 00:55.310 --> 01:00.240 That means a school is not a sensitive language so you can use them. 01:00.260 --> 01:02.840 The ball caps as well as upper caps. 01:02.840 --> 01:06.140 I'm using them about caps just to make them readable. 01:06.410 --> 01:12.290 So these are all my values and the upper caps are related to instruction from a screen. 01:12.300 --> 01:13.520 See my followed here. 01:15.830 --> 01:22.530 All the values in uppercase was for school and all the values in lowercase are my dedicated name. 01:22.670 --> 01:23.860 So that's fine. 01:23.900 --> 01:25.970 Once that is done I just need to pass out. 01:25.970 --> 01:26.740 Come in. 01:26.930 --> 01:28.000 So things looks fine. 01:28.130 --> 01:30.730 But remember this is the worst case scenario. 01:31.010 --> 01:32.600 Nobody I would be talking about. 01:32.600 --> 01:39.080 Best case but whenever we tried to use this method this method is actually the worst case and it can 01:39.080 --> 01:41.530 be caught with a squeal injection. 01:41.570 --> 01:43.740 We'll be talking about best case as well. 01:44.210 --> 01:48.740 Let me run this one so we can see how our values are added in our table. 01:48.740 --> 01:49.730 Let me run this one. 01:50.630 --> 01:52.970 I haven't got any error tense looks fine. 01:52.970 --> 01:55.240 Let me open my database. 01:55.370 --> 01:57.010 We have one table. 01:57.050 --> 01:58.550 Let me browse data here. 01:59.150 --> 02:00.480 Yeah I got my data. 02:02.780 --> 02:03.520 So that's all. 02:03.520 --> 02:04.090 Thanks for. 02:04.180 --> 02:07.750 And even if I don't pass my I.D. It would take or increments. 02:07.750 --> 02:14.740 That means if I pass new data without I.D. It will take it as two then three then four and follow on. 02:14.740 --> 02:17.160 So this is the first method that we can use. 02:17.350 --> 02:21.320 The second method we can use is cushion mark as place. 02:21.760 --> 02:24.020 So it would follow the same index. 02:24.040 --> 02:30.820 All I have to do is instead of using and passing out my proper value I just need to pass caution marker. 02:30.910 --> 02:33.850 And then I need to pass a second entity as double. 02:33.850 --> 02:39.130 With all the values that we did these values from head and pass caution mark as place holder. 02:39.310 --> 02:46.150 So we have 5 values that has IDI named Sandy department in position and then all I have to do is after 02:46.150 --> 02:50.980 this particular query I need to pass second entity with all the values US couple. 02:50.990 --> 02:52.110 So this looks fine. 02:52.110 --> 02:59.010 That means that as to let me change to values on it's done. 02:59.480 --> 03:02.580 So this is our entity in the form of double. 03:03.090 --> 03:09.200 And remember we need to take it off number of caution marks and this would not automatically mean all 03:09.200 --> 03:10.520 the values. 03:10.580 --> 03:12.710 Let me run this query also. 03:12.710 --> 03:18.470 We currently have one value already saving our database so if I'm going to run this one it would receive 03:18.740 --> 03:19.640 second value 03:25.240 --> 03:26.240 refresh this one. 03:26.410 --> 03:26.680 Yeah. 03:26.700 --> 03:31.000 We have two values now and this looks totally fine. 03:31.150 --> 03:36.230 I hope now you are able to understand how to insert value in our database. 03:36.280 --> 03:38.660 Important thinkers in real life projects. 03:38.800 --> 03:41.500 We don't pass each value individually. 03:41.500 --> 03:48.160 We use everything in dynamically that is we create a function for insert we create a function for update 03:48.250 --> 03:54.190 create a function for delete and then pass the values in that particular function that value would be 03:54.190 --> 03:54.810 used here. 03:55.390 --> 03:58.130 So we should be doing that by the end of this call. 03:58.150 --> 04:00.310 Don't worry that's all for this lecture. 04:00.310 --> 04:04.930 We have inserted our value in the next lecture let us talk about how to update our daemon.