WEBVTT

00:00.360 --> 00:01.110
All right.

00:01.110 --> 00:04.770
So we saw how we can create databases and destroy them.

00:04.770 --> 00:06.650
So what comes next.

00:07.110 --> 00:09.120
We're going to see how we actually use them.

00:09.420 --> 00:12.690
And I mean that in a very literal sense in my as well.

00:12.750 --> 00:21.000
There is a use command and what this does is it tells me as well which database we want to be working

00:21.000 --> 00:21.780
with.

00:21.810 --> 00:29.520
So we have potentially 10 different databases on one my a school server and we want to search some data

00:29.520 --> 00:30.440
from one of them.

00:30.690 --> 00:36.420
What we need to tell my as well which one we want to be using at any given time and we can switch between

00:36.420 --> 00:40.330
them using the use command that you see right here.

00:41.070 --> 00:43.840
So really quickly show you how it works over in cloud 9.

00:44.220 --> 00:45.870
So if we create a new database

00:48.640 --> 00:55.850
then we'll just call this one dog walking app and we hit enter.

00:56.220 --> 00:59.050
We do show databases.

00:59.340 --> 01:00.830
There it is.

01:00.840 --> 01:10.180
And if I want to use that all I have to do is type use dog walking app and you won't see much except

01:10.180 --> 01:12.730
for database changed.

01:13.210 --> 01:14.030
That's a good thing.

01:14.260 --> 01:19.660
But if we wanted to know for sure what database we are currently using there there's another in my escarole

01:19.660 --> 01:26.430
command that we can use that command looks like this select database with parentheses after it.

01:26.600 --> 01:30.220
And what this will do is tell you the currently used database.

01:30.250 --> 01:31.240
So let's try that out.

01:31.240 --> 01:32.540
Back in cloud 9.

01:32.830 --> 01:41.380
If I type select database with those parentheses and a semi-colon that tells me database is dog walking

01:41.380 --> 01:51.340
app and if I decided to delete that database I would use the drop database dog walking app command.

01:52.140 --> 02:00.280
It tells me queery OK I do show databases and it should be gone but if I do my select database command

02:01.180 --> 02:06.670
pause and think to yourself for a moment what database do you think I'll be using right now.

02:06.670 --> 02:11.440
We were using the dog walking app but then we deleted it.

02:11.440 --> 02:14.430
So now what.

02:14.620 --> 02:16.010
And here's the answer.

02:16.090 --> 02:17.310
Kind of a trick question.

02:17.320 --> 02:22.870
We're not using a database right now and the no here and we'll be talking a bit more about NO throughout

02:22.870 --> 02:26.670
this course but that basically means we're not using any database.

02:26.710 --> 02:29.190
So just to show you one more time if we switch.

02:29.230 --> 02:33.970
Let's say I wanted to use one of these preexisting ones like the C-9 database.

02:34.000 --> 02:35.270
I'm not going to do that.

02:35.830 --> 02:40.060
But if I wanted to I just use C9.

02:40.240 --> 02:42.160
And now if I do my select database

02:45.080 --> 02:47.620
tells me database is se'nnight.

02:47.900 --> 02:51.080
OK so that's all there is to using a database.

02:51.260 --> 02:55.490
And then also this select database command to see your current database.

02:55.490 --> 03:00.510
Next up we'll start talking about tables and putting some data in these databases as soon as possible.
