1 00:00:00,730 --> 00:00:01,480 Welcome back. 2 00:00:01,660 --> 00:00:04,700 Let's go back into our database. 3 00:00:04,840 --> 00:00:10,830 We've just created our users table. But now we want to actually insert some information. How can we do 4 00:00:10,830 --> 00:00:20,940 that? Again using SQL we have the 'insert into' command that we're able to insert into whichever 5 00:00:20,940 --> 00:00:22,340 table name we want. 6 00:00:22,470 --> 00:00:29,910 We're going to specify the column and then the values of each of those respective columns and always 7 00:00:29,910 --> 00:00:31,300 ending in a semicolon. 8 00:00:32,250 --> 00:00:37,910 I also want to emphasize that with SQL the capitalization is just a standard. 9 00:00:37,920 --> 00:00:40,470 But if I made this lowercase it will still work. 10 00:00:40,590 --> 00:00:42,480 It's case insensitive. 11 00:00:43,260 --> 00:00:47,680 So looking at our database we have name, age and birthday. 12 00:00:47,790 --> 00:00:53,430 Let's insert something. We'll say that we want to insert into 13 00:00:56,200 --> 00:00:56,690 users 14 00:00:59,350 --> 00:01:06,030 column_1 will be name and then we have age, 15 00:01:10,140 --> 00:01:10,550 birthday 16 00:01:13,910 --> 00:01:20,390 and no you don't have to insert every time into every column. You can just change the name if you want. 17 00:01:22,740 --> 00:01:24,480 Alright name will be 18 00:01:27,450 --> 00:01:27,930 'Andrei' 19 00:01:30,730 --> 00:01:43,860 value will be 31 and then BIRTHDAY we'll say is if you remember the day syntax if i open up here is 20 00:01:43,980 --> 00:01:46,650 this year, month, date. 21 00:01:46,800 --> 00:01:49,380 So I simply do 19- 22 00:01:50,090 --> 00:02:03,840 I'm going to make myself really old. We'll say January 25th. Press enter I get insert, awesome. If I do 23 00:02:03,840 --> 00:02:05,430 \d again. 24 00:02:06,500 --> 00:02:11,000 I see my table but how can I see the value that I just entered. 25 00:02:12,310 --> 00:02:13,630 Well first let's check here. 26 00:02:13,930 --> 00:02:23,470 Let's check with our GUI. Click on content, select users and look at that name, age, birthday. I have Andrei 27 00:02:23,590 --> 00:02:26,110 31 with my birthday. 28 00:02:27,460 --> 00:02:28,650 Very cool. 29 00:02:28,660 --> 00:02:31,300 Now, how can we grab this information? 30 00:02:33,950 --> 00:02:40,860 Again a SQL syntax is 'select' and we want to say what we want to select. 31 00:02:40,910 --> 00:02:44,780 In our case we can say name, age, birthday. 32 00:02:45,440 --> 00:02:48,300 From and then the table name. 33 00:02:48,470 --> 00:02:52,850 In our case users. Semi-colon, press enter and look at that 34 00:02:52,970 --> 00:03:02,960 I get Andrei, age 31, birthday. If I want to just grab the entire columns without spelling out everything. 35 00:03:02,960 --> 00:03:11,820 Imagine if we had tons of columns. We can use the wildcard symbol of star that's shift + 8 to get star 36 00:03:13,280 --> 00:03:14,480 and I get the same thing. 37 00:03:15,820 --> 00:03:16,620 Very cool. 38 00:03:16,840 --> 00:03:23,950 By the way with PSequel, we can actually run these queries here. 39 00:03:23,950 --> 00:03:25,430 See how it already has 'select'. 40 00:03:25,480 --> 00:03:33,670 I can say select * from users and it even gives me nice coloring, press ENTER or press semicolon 41 00:03:34,360 --> 00:03:37,490 and run query and look at that. 42 00:03:37,650 --> 00:03:43,800 It gives me the table for me. And it also has the history which is really really nice. 43 00:03:45,230 --> 00:03:47,050 Let's add a few more users here. 44 00:03:50,440 --> 00:03:53,860 I'm going to insert this time somebody else. 45 00:03:53,860 --> 00:03:56,740 I'm just going to change a few things. 46 00:03:57,040 --> 00:04:02,580 41 And Sally inserted. 47 00:04:02,670 --> 00:04:08,750 If I select star from users I have Andrei and Sally. Going back here, 48 00:04:08,790 --> 00:04:13,080 run query. I have Andre and Sally in the database. 49 00:04:13,080 --> 00:04:14,010 How cool is that. 50 00:04:14,810 --> 00:04:16,880 All right we know how to create a table. 51 00:04:16,940 --> 00:04:22,850 We know how to insert into a table and we know how to grab this information. We can already start picturing 52 00:04:22,910 --> 00:04:28,860 what powers we can have now with our final project. But there's still a few more things we want to learn. 53 00:04:29,780 --> 00:04:32,660 For that I'll see you in the next video bye-bye.