1 00:00:00,300 --> 00:00:03,640 Hello and welcome to this feature you're on. 2 00:00:03,710 --> 00:00:13,160 ESKEW sir at the rescue will insert command is used to add data in to a table. 3 00:00:13,440 --> 00:00:21,350 We created a table earlier in our previous couple of videos. 4 00:00:21,360 --> 00:00:30,110 Now we are going to populate that table using the excuse insert command. 5 00:00:30,450 --> 00:00:40,080 I have got to add for our record editor open hand we are going to use the school insert command to add 6 00:00:40,080 --> 00:00:45,090 some records in to the table we created earlier. 7 00:00:45,360 --> 00:00:49,410 So let's see what columns are in the table at the moment. 8 00:00:49,410 --> 00:00:54,090 So the table name we created was destinations so we do select 9 00:00:57,470 --> 00:01:03,090 darkstar means bring back everything from 10 00:01:07,630 --> 00:01:16,440 Right so select means bring back star means everything from the location of the table and destination 11 00:01:16,440 --> 00:01:25,690 is the name of the table and then put it end with our semicolon and run that so we know that we. 12 00:01:25,800 --> 00:01:29,820 This table is currently empty is got three columns. 13 00:01:29,850 --> 00:01:33,060 Destination city and country. 14 00:01:33,060 --> 00:01:41,790 So we going to use the square insert command to add some records in to the table so to do that you start 15 00:01:41,790 --> 00:01:45,960 the command with insert to do insert into 16 00:01:48,550 --> 00:01:51,230 your insert in in two. 17 00:01:51,230 --> 00:01:54,550 You got to specify the name of the table. 18 00:01:54,630 --> 00:01:56,520 The table is destination 19 00:02:01,920 --> 00:02:07,890 and then the next line you specify the values. 20 00:02:09,420 --> 00:02:13,480 So we know that the table has got three columns. 21 00:02:13,490 --> 00:02:16,990 Destination idea city and country. 22 00:02:17,050 --> 00:02:19,260 So that's what the values mean. 23 00:02:19,410 --> 00:02:29,820 So to specify the values you put them into inside parentheses the last one and then enclosing one as 24 00:02:29,820 --> 00:02:30,200 well. 25 00:02:30,240 --> 00:02:35,520 In between the parentheses is where you specify your values. 26 00:02:35,560 --> 00:02:39,280 All right so the first one is a destination idea. 27 00:02:39,540 --> 00:02:45,180 So are we going to use a sequence for this one so that the numbering is automatic. 28 00:02:45,210 --> 00:02:52,530 Remember in the previous video we created a sequence for this table saw this sequence. 29 00:02:52,530 --> 00:02:58,890 We need to use that now so the name of the sequence is destination. 30 00:03:05,070 --> 00:03:06,890 Underscore Yes. 31 00:03:06,920 --> 00:03:12,730 Q Does the name of this sequence and when you do next. 32 00:03:12,740 --> 00:03:15,290 You do a dot then next 33 00:03:20,760 --> 00:03:29,360 Nagas Val neg's far means no age should be the next available numbering in this case because we've not 34 00:03:29,360 --> 00:03:30,390 used did before. 35 00:03:30,450 --> 00:03:35,450 So I expect this idea here to have a number of one. 36 00:03:35,750 --> 00:03:42,380 So we'll pull a common cause we have now given a value to this one here. 37 00:03:42,560 --> 00:03:48,530 Vi the why sequence so the sequence is going to create numbering here. 38 00:03:48,770 --> 00:03:52,050 Next we need to specify this CTE. 39 00:03:52,280 --> 00:04:00,720 So our specifier let's see New York. 40 00:04:03,380 --> 00:04:12,500 You always have to surround your text in quotes pinned on a string so you need to so out surround the 41 00:04:12,590 --> 00:04:15,540 strings in quotes. 42 00:04:15,620 --> 00:04:20,220 So the first New York City New York. 43 00:04:20,570 --> 00:04:22,890 And then a comma. 44 00:04:23,270 --> 00:04:26,770 The final call on this country be you see. 45 00:04:26,870 --> 00:04:33,370 Who do you saying. 46 00:04:34,270 --> 00:04:40,780 All right so I've got my three three columns now populated destination. 47 00:04:40,790 --> 00:04:43,630 They will be populated by the sequence. 48 00:04:43,700 --> 00:04:50,720 The city is New York country USC and then end that with a semicolon. 49 00:04:50,720 --> 00:04:52,750 It's always important to end your state. 50 00:04:52,750 --> 00:04:54,180 No semicolon. 51 00:04:54,230 --> 00:05:01,780 So if I run that now I should have a new record inserted so I go run. 52 00:05:02,120 --> 00:05:08,630 We did and like that for something Okay let's see what's gone on here in invalid statement. 53 00:05:08,630 --> 00:05:09,340 Let's have a look. 54 00:05:09,350 --> 00:05:10,230 Okay let's. 55 00:05:10,270 --> 00:05:16,930 Some space there that again because I left the gap. 56 00:05:16,920 --> 00:05:19,980 You see that is now done one row. 57 00:05:19,990 --> 00:05:23,560 Insert it one row insert is inserted record. 58 00:05:23,690 --> 00:05:30,590 So be careful with your spaces when you are adding values because the editor might complain as you just 59 00:05:30,590 --> 00:05:31,610 did with mine. 60 00:05:31,670 --> 00:05:33,120 So let's check that out. 61 00:05:33,130 --> 00:05:37,740 So if we run this query on the top here we should have some data in there now. 62 00:05:37,820 --> 00:05:47,960 So to run say that the numbering is 1 courtesy of the sequence in New York country you see excellence 63 00:05:47,960 --> 00:05:49,530 or we've now inserted. 64 00:05:49,700 --> 00:06:00,220 Eric hold him to a table using the insert command to use in practice and just insert a few more. 65 00:06:00,230 --> 00:06:03,670 I'll just insert a few more. 66 00:06:03,680 --> 00:06:07,220 I will see changes to London 67 00:06:11,830 --> 00:06:13,500 and change that to you. 68 00:06:13,510 --> 00:06:20,230 Key and there run that C inserted on another roll. 69 00:06:20,240 --> 00:06:29,610 So if I run this I should have two records now and go round C and got two records numbering is in order. 70 00:06:29,690 --> 00:06:33,250 Was done that and it took comit always commager work. 71 00:06:33,250 --> 00:06:38,870 Once you are done because once you execute the data would be in there but it will not be permanent so 72 00:06:38,870 --> 00:06:41,600 you need to Committed to be permanent. 73 00:06:41,690 --> 00:06:48,490 Once you've executed all your query you can sue rawabi if you are not happy but once you commit it that's 74 00:06:48,490 --> 00:06:48,800 it. 75 00:06:48,830 --> 00:06:49,990 You can roll back. 76 00:06:50,150 --> 00:06:56,350 So are now committed the values into the database. 77 00:06:56,510 --> 00:07:03,320 So practice some more insert in some more rows into this table saw. 78 00:07:03,320 --> 00:07:15,250 In this video we learned how to use the escudo insert command to insert new records into a table. 79 00:07:15,530 --> 00:07:18,670 I hope we've had you as being useful. 80 00:07:18,950 --> 00:07:23,120 Thank you so much for your time as always you take care. 81 00:07:23,120 --> 00:07:24,190 Bye for now.