WEBVTT

00:08.300 --> 00:13.580
I will call you back again to another lecture in PostgreSQL, and in this video lecture I will go ahead

00:13.580 --> 00:16.880
and teach you how to connect to PostgreSQL database.

00:16.910 --> 00:25.010
So in the previous lecture we are able to actually install our database and we go to apps and move down

00:25.010 --> 00:25.430
here.

00:25.430 --> 00:29.870
You can go over to displays and you can see PostgreSQL.

00:29.870 --> 00:31.940
And I'm using Windows 11.

00:31.940 --> 00:33.740
So I didn't go.

00:34.190 --> 00:39.020
If you're using Windows 10 or below, you can go ahead and check out our desktop menu.

00:39.020 --> 00:41.780
And you're going to see PostgreSQL 17.

00:41.870 --> 00:43.640
So go ahead and open up this.

00:43.640 --> 00:47.360
And right in here we have the Pgadmin four.

00:47.360 --> 00:50.060
And we have the SQL shell.

00:50.240 --> 00:56.300
So in PostgreSQL most of the things that we use and is mostly the SQL.

00:56.300 --> 00:59.630
So the SQL shell is what we actually use.

00:59.630 --> 01:01.490
That is the SQL.

01:02.570 --> 01:04.280
That is what we're going to be using here.

01:04.310 --> 01:08.630
So it can actually go ahead and double click on this and that will come up.

01:08.630 --> 01:10.460
So I double click on that twice.

01:10.460 --> 01:18.170
And I can also go over and also check out for the graphical interface.

01:18.200 --> 01:20.060
Go ahead and move down here.

01:20.240 --> 01:24.290
And then go ahead and click on Pgadmin four.

01:24.290 --> 01:26.030
So I'm going to open both of them.

01:26.030 --> 01:32.480
And then I'll go ahead and show you how to connect to your database using both of the applications.

01:32.480 --> 01:38.870
So mainly in this course I will be using the SQL because that is what I'm going to be using here.

01:38.870 --> 01:44.750
And you can also go ahead and check out on the Pgadmin.

01:44.750 --> 01:45.710
And that is coming up.

01:45.710 --> 01:47.990
So this is our Pgadmin is coming up.

01:47.990 --> 01:49.730
So when it comes on I'll go ahead.

01:49.730 --> 01:52.790
And this data now for the SQL.

01:52.790 --> 01:54.380
Let's go ahead and look at this.

01:55.100 --> 01:57.740
So if this console you're going to see localhost.

01:57.740 --> 02:03.110
And because you're working on a computer because we downloaded this and now we are not actually going

02:03.110 --> 02:04.670
to use the remote server.

02:04.670 --> 02:09.040
So if you have a remote server you can actually put that right in here.

02:09.040 --> 02:12.640
But because you can see look I'll go ahead and hit on enter.

02:12.640 --> 02:16.330
And now you're going to choose the database you're going to use.

02:16.330 --> 02:22.240
And during the time of installation it actually installs a default database.

02:22.240 --> 02:25.540
And that default database is PostgreSQL database.

02:25.540 --> 02:32.260
And you're going to go ahead and leave it the way it is for now and go ahead and hit on part.

02:32.260 --> 02:35.170
And then if you hit enter you move over to port.

02:35.170 --> 02:39.340
And then the port we're using is a default port 543, two.

02:39.340 --> 02:41.320
And then go ahead and hit enter.

02:41.320 --> 02:42.760
And it says the username.

02:42.760 --> 02:45.760
So we're still going to leave that and hit enter.

02:45.760 --> 02:47.830
And it's going to ask for your password.

02:47.830 --> 02:50.680
So this is the password you created at the time of installation.

02:50.680 --> 02:53.890
And the password I created is simple.

02:53.920 --> 02:55.540
Just 1234.

02:55.540 --> 02:56.800
And that is my password.

02:56.800 --> 02:58.510
And it cannot see the password shown.

02:58.510 --> 03:09.130
But go ahead and hit on enter and it says SQL 17 and I say 17 console code based on windows code page.

03:09.160 --> 03:15.130
And now over here you can actually start off and move on.

03:15.160 --> 03:19.030
Right now we've connected to PostgreSQL database.

03:19.330 --> 03:19.930
All right.

03:19.960 --> 03:22.990
Now let me go ahead and see okay.

03:23.020 --> 03:27.400
You might be like how that we are not actually connected to this database.

03:27.430 --> 03:33.130
If I go ahead and close this and this is my pgadmin open, I'm going to leave that for now.

03:33.160 --> 03:41.230
I'll go back right in here and I'm going to open this again, and I'm going to move over to the PostgreSQL

03:41.230 --> 03:41.950
17.

03:41.950 --> 03:44.800
And I'm going to hit on the SQL show.

03:44.800 --> 03:46.060
And that is it.

03:46.720 --> 03:54.220
Now if I should go ahead and go over to database and I name this database anything, let's say new data

03:54.550 --> 03:55.240
base.

03:55.480 --> 03:58.150
Let me say maybe you think we don't have a database.

03:58.180 --> 03:58.930
We have a database.

03:58.960 --> 03:59.440
All right.

03:59.530 --> 04:07.780
So if I go ahead and say any database or I'm going to say my database a resume, you can give a name.

04:07.780 --> 04:11.770
So this is just for a test to show that this database will not work because you don't have a database

04:11.770 --> 04:12.970
called my database.

04:12.970 --> 04:15.400
What you have is database is PostgreSQL.

04:15.400 --> 04:21.280
So if I go ahead and hit on this and go ahead and hit on this and enter this and say one, two, three,

04:21.280 --> 04:25.120
four and hit on these, it says error connection.

04:25.570 --> 04:28.810
The server at localhost port failed.

04:28.840 --> 04:31.090
My database does not exist.

04:31.120 --> 04:32.830
You see that my database does not exist.

04:32.830 --> 04:38.200
So whenever we are entering you know that a database PostgreSQL actually exists.

04:38.230 --> 04:42.700
That was why it actually connected to our very first trial.

04:42.700 --> 04:44.560
So close this and open that.

04:44.560 --> 04:50.230
Again, the reason why I'm making this is to let you know that we have a database already today.

04:50.260 --> 04:55.600
Now let's go ahead and go back here and hit on SQL again.

04:55.600 --> 04:58.330
And now go ahead and hit enter.

04:58.330 --> 05:01.810
And then you insert your password.

05:01.810 --> 05:06.550
If you want to insert the password you can see we have error no password supplied.

05:06.550 --> 05:11.800
So I'm saying all this because if you have a mistake or you run into any problem, you can know that

05:11.800 --> 05:13.030
these problems are shown.

05:13.060 --> 05:14.830
Now go ahead and close this again.

05:14.830 --> 05:16.390
And then we go over here.

05:16.390 --> 05:20.860
And now try to open it for the last time so we can move it to.

05:21.250 --> 05:21.760
No worries.

05:21.850 --> 05:28.930
Then why I was able to actually draw these things is to help us to actually get these things done and

05:28.930 --> 05:29.440
running.

05:29.470 --> 05:37.420
Now I'll go enter enter enter enter in the password 123, four and then enter.

05:37.420 --> 05:40.210
And you can see that is now connected.

05:40.210 --> 05:42.100
And I can start writing my query.

05:42.160 --> 05:45.910
Now this is the pgadmin that we're going to use for this.

05:45.910 --> 05:53.320
So the Pgadmin is a graphical interface where you can be able to write your code, and everything is

05:53.320 --> 05:54.280
going to work out fine.

05:54.280 --> 05:56.260
Your query is actually written here.

05:56.260 --> 05:58.630
So this is what you use to write your query.

05:58.660 --> 06:04.330
Now if I go ahead and open up this, you can see I have a PostgreSQL 17.

06:04.360 --> 06:05.410
I'll go ahead and close this.

06:05.410 --> 06:07.840
So this is our PostgreSQL 17.

06:07.840 --> 06:09.010
We'll actually open.

06:09.010 --> 06:13.480
That is because I do click on this and it opened up that.

06:13.480 --> 06:17.170
So if I now click on that again go ahead and click on that.

06:17.170 --> 06:25.560
And it says please enter password for user Postgres Postgres to connect server PostgreSQL 17.

06:25.710 --> 06:31.470
Now if I should go ahead and enter the password now during the installation of this one two, three,

06:31.470 --> 06:35.160
four and that is my password and I can actually save this password.

06:35.160 --> 06:37.620
And I go here and I hit on okay.

06:37.620 --> 06:43.440
And now you can see that PostgreSQL 17 is opened.

06:43.440 --> 06:48.120
And the overlay I will go over to database and open the database.

06:48.120 --> 06:50.880
And I have a database.

06:50.880 --> 06:55.230
Two I can actually remove this because this is a database I have created some time ago.

06:55.260 --> 06:57.630
I'll go ahead and actually remove that.

06:57.660 --> 07:01.770
But what I want to show is I have a database, Postgres.

07:01.980 --> 07:04.530
And this Postgres is what we have right in here.

07:04.560 --> 07:05.190
All right.

07:05.190 --> 07:10.650
And uh, for the course we are dealing with, uh, Postgres.

07:10.680 --> 07:11.280
Okay.

07:11.310 --> 07:15.000
When are we looking at, uh, because you don't have this.

07:15.000 --> 07:21.720
So I have been working, um, over the years, and I have a database I don't want to put down, and

07:21.720 --> 07:22.860
that is why I'm writing here.

07:22.890 --> 07:25.080
But on that you're going to see just one.

07:25.080 --> 07:27.060
And that is the Postgres.

07:27.060 --> 07:29.190
And that is what we're going to see right in here.

07:29.190 --> 07:37.380
And if you go down to schema and you can see we don't have anything, and if you go to your tables and

07:37.380 --> 07:42.720
you're going to see that your table is still empty, all right, because you have not created that.

07:42.720 --> 07:48.240
But uh, if you go to something like Noah is a database we have some time ago.

07:48.240 --> 07:55.620
And, um, if I go to schema and I moved down to my tables and then under here, I have a table called

07:55.620 --> 07:56.460
students.

07:56.490 --> 07:56.940
All right.

07:56.940 --> 08:00.150
So you want to learn how to create all these step by step.

08:00.150 --> 08:01.860
So it's going to be interesting.

08:01.860 --> 08:03.120
It's going to be fun.

08:03.150 --> 08:08.010
Just go ahead and relax and let's go over and start off immediately.

08:08.010 --> 08:14.310
So I'm going to say if you have any question on that is please use the question and answer section.

08:14.340 --> 08:19.710
Otherwise we'll move over to the next video lecture and uh kick off immediately.

08:19.740 --> 08:22.890
Thank you and see you in the next video lecture.
