WEBVTT

00:07.640 --> 00:12.620
I will call you back again to another video lecture in PostgreSQL, and in this video lecture I'll walk

00:12.620 --> 00:15.890
ahead and explain the basic syntax that is very important.

00:15.920 --> 00:21.500
We must tie it because it's going to help us in implementing our queries.

00:21.500 --> 00:24.410
And that is the select keyword.

00:24.800 --> 00:25.250
All right.

00:25.280 --> 00:27.410
So I've always used the select keyword.

00:27.410 --> 00:34.190
And now if you have the knowledge of SQL this is not a problem because you have always known what it

00:34.190 --> 00:34.820
is.

00:34.820 --> 00:39.770
What if you are new in SQL or this is a very first time learning SQL?

00:39.800 --> 00:47.510
You might be like I've always used select all from students and how do I select all the things.

00:47.900 --> 00:56.180
So the keyword select which is this is used to select a colon.

00:56.180 --> 01:00.920
You can be able to show a colon and some roads and all the roads.

01:00.950 --> 01:06.170
Well if you go ahead and hit on exteriors, it means you want to select all the columns.

01:06.170 --> 01:09.780
You want to display all the columns of variable in your table.

01:09.780 --> 01:12.390
So select all means.

01:12.390 --> 01:14.490
I want to display everything.

01:15.060 --> 01:15.810
All right.

01:15.810 --> 01:20.100
And you now select from that table.

01:20.100 --> 01:21.510
You want to display that.

01:21.510 --> 01:24.390
So the table is students.

01:25.230 --> 01:27.630
And then you put accessories at the end of this.

01:27.660 --> 01:29.880
So select all from students.

01:29.880 --> 01:35.370
And if you hit enter it will go ahead and generate everything right in here.

01:35.430 --> 01:35.970
All right.

01:35.970 --> 01:39.540
So I'll go ahead and move this down down.

01:39.540 --> 01:41.130
And we click enter.

01:41.160 --> 01:43.500
It's keep moving down and down.

01:43.650 --> 01:45.960
Now let me why had I use this.

01:45.960 --> 01:47.700
Because this might be more easier.

01:47.730 --> 01:52.260
But whatever you do here is still going to be done in any of them.

01:52.290 --> 01:54.720
You know the skew ratio or the pgadmin.

01:54.720 --> 01:58.560
So if I query this using select all, I have all these.

01:58.560 --> 02:00.540
So I think this is much easier for me.

02:00.690 --> 02:06.120
Now I can be able to select maybe the first name, the last name email or gender.

02:06.120 --> 02:09.360
So if I want to do that I'll go ahead and say select.

02:09.390 --> 02:15.270
I will remove the categories and I'm going to give a specific detail a column I want.

02:15.300 --> 02:19.330
Maybe I'm going to say select first underscore name.

02:19.360 --> 02:22.030
And this is going to display only the first name.

02:22.060 --> 02:22.510
Go ahead.

02:22.510 --> 02:23.710
And that is the query.

02:23.710 --> 02:28.030
And you can see I have select first name from students.

02:28.030 --> 02:30.250
And I have the first name displayed.

02:30.340 --> 02:33.370
And I can move this down to 1000.

02:33.400 --> 02:38.920
All right so I can add more of these I can say select column.

02:38.920 --> 02:42.520
And what I need to do is to go ahead and put a comma.

02:42.520 --> 02:45.850
And I'm going to say last underscore name.

02:45.850 --> 02:47.830
And I want to execute this query.

02:47.830 --> 02:50.290
And I'm going to see first name and last name.

02:50.290 --> 02:51.220
Last name.

02:52.540 --> 02:53.530
How about is cool.

02:53.530 --> 03:00.520
So I can also go ahead and uh add maybe I want to select uh maybe the email.

03:00.550 --> 03:02.140
This is going to be sequential.

03:02.170 --> 03:07.720
So if I go over here and I have email gender insert date.

03:07.720 --> 03:15.010
So I can also say maybe I want to select the enroll date in rule underscore date.

03:15.010 --> 03:16.960
And let's go ahead and check it out.

03:16.960 --> 03:18.910
So I have this right in here.

03:20.620 --> 03:27.500
So you can see how this select keyword works I can also go ahead and remove everything and say I want

03:27.500 --> 03:28.970
to select just the email.

03:28.970 --> 03:39.080
So I'll select email from students and then a warhead and a hit on this and have the email selected

03:39.080 --> 03:39.830
for me.

03:40.280 --> 03:43.100
So this is what the select keyword actually does for us.

03:43.100 --> 03:50.330
You can use the select keyword to select either all the columns or some of the columns and so on.

03:50.330 --> 03:56.780
So it's a very important aspect in SQL queries and how you're always going to use that to query your

03:56.780 --> 03:59.120
table and be able to display results.

03:59.120 --> 04:03.950
So it's very important we know this before we move on because we're going to use these.

04:03.950 --> 04:09.080
And why I introduced these in this video lecture is because I have imported a large data set.

04:09.080 --> 04:15.500
And I need to explain this basic syntax so it can be good to master it and move on in this course.

04:15.500 --> 04:17.690
So check it out, practice with it.

04:17.720 --> 04:20.900
If you have any questions, go ahead and use the question and answer section.

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

04:23.480 --> 04:24.290
Thank you so much.

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