WEBVTT

00:07.640 --> 00:11.120
I will call you back again to another video lecture on PostgreSQL.

00:11.120 --> 00:18.530
And in this lecture I'll go ahead and teach you how to create your very first database in PostgreSQL.

00:18.740 --> 00:21.650
Now let's go ahead and kick off immediately.

00:21.680 --> 00:27.680
So in PostgreSQL we always use the backward slash to do anything.

00:27.770 --> 00:28.700
Let's go ahead and see.

00:28.730 --> 00:32.930
We have our SQL shell because that is what we are going to be using right in here.

00:32.930 --> 00:35.870
And I will also be showing you that on the Pgadmin as well.

00:35.900 --> 00:42.620
So if I go ahead and select the local server or go ahead, I hit enter and our database PostgreSQL.

00:42.620 --> 00:46.700
And then we go ahead and select the ports 5432.

00:46.730 --> 00:48.680
Go ahead and enter the username.

00:48.680 --> 00:53.060
And then we'll go ahead and enter our password as 1234.

00:53.090 --> 00:54.920
Let's go ahead and hit on this.

00:54.920 --> 01:00.290
So in PostgreSQL you use the backward slash for everything you want to do.

01:00.320 --> 01:02.290
Let me say I want to tick for hell.

01:02.320 --> 01:09.940
You can type help, and if you want to do that, you go ahead and, uh, see backward slash and then

01:09.940 --> 01:13.840
you go ahead and hit on type help.

01:13.840 --> 01:17.380
And if you click on that you're going to get all these.

01:17.950 --> 01:18.640
You see that.

01:18.640 --> 01:26.020
So we use a backward slash to actually execute programs in SQL shell.

01:26.050 --> 01:31.120
Now I'll go ahead and close these because I have another shell right behind.

01:31.150 --> 01:33.970
Now let's go ahead and create our first database.

01:34.090 --> 01:37.870
And we're going to use the backward slash for this and every other thing we're doing.

01:37.900 --> 01:39.460
Go ahead and hit enter.

01:39.580 --> 01:43.570
And then we'll go ahead and put our password 1234.

01:43.600 --> 01:46.180
You're always going to use a stronger password for this.

01:46.180 --> 01:48.940
And then you go ahead and connect.

01:48.970 --> 01:54.190
Now if I want to view all this database go back to our Pgadmin.

01:54.190 --> 01:54.910
We have a memoir.

01:54.910 --> 01:57.700
We have Postgres and uh edit database.

01:57.700 --> 01:58.480
I want to view.

01:58.510 --> 02:03.310
If I want to do that, all I need to do is put a backward or slash and put L.

02:03.340 --> 02:10.480
Any time you add L to these, you go ahead and hit enter and you can see the database you have.

02:10.510 --> 02:16.120
I have a memoir, I have Postgres, I have a template and templates one nice templates and template

02:16.150 --> 02:16.450
one.

02:16.450 --> 02:19.120
So I have four of this database right in here.

02:19.120 --> 02:21.820
But we have not created our own database.

02:21.850 --> 02:25.360
Now let's go ahead and create our very first database in this course.

02:25.360 --> 02:32.410
So to create a database what we are going to do is we are not going to use the backward slash for creation

02:32.410 --> 02:37.540
of the database, but for the kitchen, uh, all these commands you go ahead and use backward slash.

02:37.540 --> 02:42.460
But to create your actual database, you're not going to use the backward slash or you're going to use

02:42.460 --> 02:46.330
is you're going to use a keyword called create.

02:46.330 --> 02:48.910
And this keyword is not case sensitive.

02:48.910 --> 02:50.050
It can be lowercase.

02:50.050 --> 02:51.370
It can be uppercase.

02:51.400 --> 02:52.000
All right.

02:52.000 --> 02:54.760
So you can use it in lowercase or uppercase.

02:54.760 --> 03:02.610
But for this course and for professional levels you always use the uppercase in order to differentiate

03:02.610 --> 03:06.270
your keywords and the SQL queries.

03:06.300 --> 03:06.900
All right.

03:06.930 --> 03:07.650
Coherency.

03:07.650 --> 03:08.250
Great.

03:08.250 --> 03:10.530
Uh, database.

03:10.560 --> 03:13.740
And then you give the name of the database you want to create.

03:14.310 --> 03:15.840
So you go ahead and add your name.

03:15.870 --> 03:19.800
Let me go ahead and say give your database name according to the project you're working on.

03:19.830 --> 03:21.060
I can go ahead and see.

03:21.060 --> 03:29.850
I'm creating a database for students and I can say create database student and go ahead and put a semicolon

03:29.850 --> 03:30.600
at the end.

03:30.630 --> 03:37.470
Ensure you add a semicolon at the end of your database creation or any of the commands or any of your

03:37.470 --> 03:37.950
query.

03:37.980 --> 03:40.920
That would be the semicolon at the end.

03:40.950 --> 03:42.750
Then go ahead and hit enter.

03:42.750 --> 03:47.130
And uh under here you can see Create database.

03:47.160 --> 03:49.320
Now let's go to Pgadmin four.

03:49.320 --> 03:55.530
And now I want to create a hit on Postgres or right click I refresh this and check it out.

03:55.530 --> 03:58.980
And now we have students right in here.

03:58.980 --> 04:01.620
And we have student database already created.

04:01.650 --> 04:04.380
You can actually go ahead and hit on students.

04:04.380 --> 04:11.790
And down here you can see we have students that have created for us and go to schemas and under the

04:11.790 --> 04:12.330
tables.

04:12.360 --> 04:15.570
We have no team created under here right now.

04:15.570 --> 04:19.800
So that is a new database we just created and that is the student database.

04:19.800 --> 04:24.210
So whatever you do inside the SQL shell you can always go back here.

04:24.240 --> 04:30.030
Refresh the database and you will see your database right in here.

04:30.390 --> 04:30.930
That is cool.

04:30.930 --> 04:38.640
So that is the creation of database on SQL and using the SQL shell for PostgreSQL.

04:38.670 --> 04:39.150
Right.

04:39.150 --> 04:42.240
So that is the database creation for PostgreSQL.

04:42.240 --> 04:43.620
And I hope that is cool.

04:43.620 --> 04:45.780
So pull it down and practice with it.

04:45.780 --> 04:50.580
And if you have any questions on this, go ahead and use the question and answer section.

04:50.580 --> 04:53.250
And I'm going to get back to you as soon as possible.

04:53.250 --> 04:54.180
Thank you so much.

04:54.180 --> 04:57.360
And I'm going to see you in the next video lecture.
