1 00:00:00,300 --> 00:00:00,960 All right. 2 00:00:00,960 --> 00:00:04,580 So we saw how we can create databases and destroy them. 3 00:00:04,590 --> 00:00:05,970 So what comes next? 4 00:00:07,020 --> 00:00:09,120 We're going to see how we actually use them. 5 00:00:09,240 --> 00:00:11,400 And I mean that in a very literal sense. 6 00:00:11,400 --> 00:00:15,240 In my SQL, there is a use command. 7 00:00:15,540 --> 00:00:21,570 And what this does is it tells my SQL which database we want to be working with. 8 00:00:21,660 --> 00:00:29,550 So we have potentially ten different databases on one, my SQL Server and we want to search some data 9 00:00:29,550 --> 00:00:30,540 from one of them. 10 00:00:30,540 --> 00:00:36,450 What we need to tell my SQL, which one we want to be using at any given time, and we can switch between 11 00:00:36,450 --> 00:00:39,810 them using the use command that you see right here. 12 00:00:41,040 --> 00:00:43,740 So I'll really quickly show you how it works over in Cloud nine. 13 00:00:44,070 --> 00:00:46,110 So if we create a new database 14 00:00:48,690 --> 00:00:58,260 and we'll just call this one dog walking app and we hit enter, we do show databases. 15 00:00:59,280 --> 00:01:00,300 There it is. 16 00:01:00,750 --> 00:01:06,480 And if I want to use that, all I have to do is type use dog walking app. 17 00:01:08,720 --> 00:01:12,440 And you won't see much except for database changed. 18 00:01:13,130 --> 00:01:14,090 That's a good thing. 19 00:01:14,090 --> 00:01:20,060 But if we wanted to know for sure what database we are currently using, there's another MySQL command 20 00:01:20,060 --> 00:01:26,330 that we can use and that command looks like this select database with parentheses after it. 21 00:01:26,420 --> 00:01:29,930 And what this will do is tell you the currently used database. 22 00:01:30,080 --> 00:01:31,220 So let's try that out. 23 00:01:31,220 --> 00:01:38,030 Back in cloud nine, if I type a select database with those parentheses and a semicolon. 24 00:01:38,950 --> 00:01:41,980 It tells me database is dog walking app. 25 00:01:42,460 --> 00:01:50,830 And if I decided to delete that database, I would use the drop database, dog walking App Command. 26 00:01:52,150 --> 00:01:52,760 It tells me. 27 00:01:52,780 --> 00:01:53,770 Query OC. 28 00:01:54,160 --> 00:01:56,650 I do show databases and it should be gone. 29 00:01:57,580 --> 00:02:00,520 But if I do my select database command. 30 00:02:01,150 --> 00:02:02,950 Pause and think to yourself for a moment. 31 00:02:03,100 --> 00:02:05,560 What database do you think I'll be using right now? 32 00:02:06,550 --> 00:02:11,350 We were using the dog walking app, but then we deleted it. 33 00:02:11,350 --> 00:02:12,250 So now what? 34 00:02:14,590 --> 00:02:15,670 And here's the answer. 35 00:02:16,010 --> 00:02:17,190 Kind of a trick question. 36 00:02:17,200 --> 00:02:20,770 We're not using a database right now, hence the null here. 37 00:02:20,770 --> 00:02:23,710 And we'll be talking a bit more about NULL throughout this course. 38 00:02:23,890 --> 00:02:26,530 But that basically means we're not using any database. 39 00:02:26,530 --> 00:02:31,660 So just to show you one more time, if we switch, let's say I wanted to use one of these pre-existing 40 00:02:31,660 --> 00:02:33,940 ones like the C nine database. 41 00:02:33,940 --> 00:02:38,980 I'm not going to delete that, but if I wanted to, I just use C nine. 42 00:02:40,180 --> 00:02:42,430 And now if I do my select database. 43 00:02:45,100 --> 00:02:48,250 Tells me database is C nine OC. 44 00:02:48,280 --> 00:02:54,640 So that's all there is to using a database and then also this select database command to see your current 45 00:02:54,640 --> 00:02:55,330 database. 46 00:02:55,360 --> 00:03:00,490 Next up, we'll start talking about tables and putting some data in these databases as soon as possible.