In this video, we dive deep into the most important SQL command — SELECT, the Read (R) operation from CRUD. You'll learn how to fetch data from tables, select specific columns, rename output using aliases, remove duplicate values with DISTINCT, apply filtering using WHERE, and even perform mathematical operations directly inside SELECT statements.
If you want to become a strong SQL and PostgreSQL developer, mastering SELECT is mandatory because almost every database application depends on it.
🔥 What you'll learn: ✔ SELECT basics ✔ Fetch all records using * ✔ Select specific columns ✔ Format output with AS Alias ✔ Find unique values with DISTINCT ✔ Filter records using WHERE ✔ Mathematical operations in SELECT ✔ Real practical examples in pgAdmin 4
Perfect for beginners starting PostgreSQL from scratch.
Complete PostgreSQL Playlist: [Add Playlist Link]
Subscribe for more web development tutorials ------------------------------------------------------------------------------------ 💸 Get All My YouTube Videos' Source Code for just ₹199! Grab Now - https://thapatechnical.shop/source-code
⌛TIMELINE⏳ 00:00 Introduction — PostgreSQL SELECT Query 00:15 Understanding SELECT Theory (R in CRUD) 03:00 Support Thapa Technical ❤️ 03:35 Practical Start — First SELECT Query 04:45 Select Specific Columns from Table 06:15 Format Output using AS Alias 11:30 Find Unique Data using DISTINCT 13:35 Filter Data using WHERE Clause 15:35 Powerful SELECT with Mathematical Operations 20:10 PostgreSQL Practice Task for Students
AI Generated·May contain errors
Video Summary
AI Generated
This video is the fifth part of a PostgreSQL series, focusing on the `SELECT` statement. It covers how to retrieve data, use aliases for readability, filter unique values with `DISTINCT`, apply conditional filtering with `WHERE`, and perform arithmetic calculations within queries to generate dynamic data.
Hello, what's up, guys?
Welcome, everyone, to Day 5 of Postgres SQL
Today's video we'll be watching is about the Select Query
Yes, guys, this is very important.
You can see here,
What all are we going to see today, Mene?
Mine is basically like everyday
There is a PPT file placed here with you all.
And he isn't interested in theory either.
And if you want to jump directly into practice,
I've added the timeline.
Please check in your timeline.
The practical version of this is direct humming.
You can check him out.
But I'll suggest that you take a look at this once later.
I am better than Taaki aapi.
You can see it very clearly here.
When we talk about the SELECT statement
It means you have already inserted the data.
We created tables, and we inserted the data into them.
We saw different tariqas in yesterday's videos
Now, if I need to read the data
What should I do?
Which query should I run for Tab?
You can see it very clearly here.
And that is simply using a SELECT statement
What are you guys even talking about?
Nothing at all.
The database will ask a question.
And whatever output is generated based on it
I'll fetch it for you
I will give it to you.
Basically, when we don't talk
Code operation
What is this read here
Toh usme aapka yeh select statement
It's working, right?
And you are writing a select statement
Then you are in it
You will mostly see
You are beginners, aren't you?
Starting me
No one has an asterisk.
This symbol that you are seeing
They use it.
What does this asterisk mean?
However many columns there are
Wherever you give me, you give me
That's it.
Give me
Absolutely every column
In this table
So simple, is it?
Don't worry, we will check the entire practical.
Then we have something called alias
What is an alias?
If you sometimes
Tables
Basically the names of the columns
Do you generate tables?
They are not in such a readable format.
You don't understand this at all.
Right?
What is that?
Through his alias, we reach him
I mean for a specific period of time
As long as we are running the query
I am one
They give it a different name.
You have a nickname, right?
Isn't it very hot in your alias?
They give him an alternate name.
So that humans can read it easily
Do you understand the column name?
Just one
What's up, bro?
I don't like your name
You gave him a different name.
For Tohi
As long as you are reading it
So this is your alias.
And you are useful, no doubt.
Then we have this distinct
If you don't need duplicate data
Hey guys, in our case
The table of users has roles in it.
I just want to know this:
Who are the roles in our table?
There are only 3 or 4 such roles available.
To show them 3 or 4
We will use this
You will find out soon.
And then, guys, at the end
We have something called
String concatenation
You'll also enjoy this.
And me, I give it to you
Wow, I'm not that kind of person.
In today's video, something like this
What else have I learned today?
Whatever you say
Here you will learn something amazing.
And there is one more thing
It will come soon.
When we talk about price
At college
Like, say
Your tax has increased.
Now about the tax that has just increased
That new course's fee was charged to him.
How much has it become?
It's important, isn't it?
You understand, right?
It was 5000 before, wasn't it?
He said that
Fee increased by 10%
How much has it become?
You'll sit down after calculating a little bit
How can we write this query?
You'll enjoy it.
So, without any delay, what?
Let's start𫖳
But before that
Today, our video's like target
We keep it.
Just 500 likes
I didn't even get to see the views.
How will likes come?
But whatever you are seeing
If you click the like button
I will be very happy.
Will get very motivated
Guys, believe me
With just one click of your like button
One rupee will go to you
I will get one rupee.
But at least
These videos until now
You will definitely come to the meeting.
In today's times
With AI, guys
You're the one who's crazy
He is not learning anything.
They will leave soon.
But if you are learning
Make sure that you
Learn properly
And from here to there
If we share this
We will do well.
You understand karma, just get it
I didn't subscribe to your channel
Please do it then
And the next target is
800,000 subscribers
Alright
Then, we proceed.
Our
The BS code editor was broken.
Our
Our PG admin 4 on
So number one
It's very simple indeed.
Let's see
All one hundred students
Professors
And admins
We imported
Basically
If you remember Kalki
We have completed the entire hundred
Records are here
He is going to do it.
Now I want to see everything exactly.
So very simple
It's your choice.
Asterisk
We had just learned this
Do you remember?
Look at this asterisk
Over here
We just studied asterisk.
A use case has come up from him
Yeah, that's it
Awesome
So
From which table
From users table
So run this simply here, and you'll see there's a segment.
I'll show you what he said, he's right here, look, look, the whole thing
Look ahead at the entire hundred records, hundred failures, buses were just there, weren't they?
It keeps repeating over and over; I just need as many as there are—if there are three, then three.
Just three are needed: admin, professor, and student — and they need to see us, okay?
Alright, let me remove this. Okay, so check out how easy this is.
Put an asterisk if you want to find everyone at once.
If you need it, you keep it, okay? But it's our pin, you know.
You didn't realize it either, but now you will know. Now we will tell you what
If you're feeling down, what should I do? Or should I just send an email?
I'll give them an alien, okay?
As I have written to you
But if we look closely
Our name is a full flower name.
Select Name
You will have to write "S"
Look, it must say the same thing here too
Look, what's written here—this is it, this is yours, this is it, this is the keyword, it's here, so if you write it like this, you'll feel much better, but you can write it this way for anyone, but if your typing is good, then...
As I wrote here, you write just what I wrote here. You'll feel it's good, brother, but after more dye, it'll look better. Then you write after this, but write correctly, properly. Here.
You can see itdealer
Full Name and then Contact
You are seeing it in this way, it appears to you like this
Yeah? Just a little bit
I do it like that, man, it's fine
So Full Name and then we have this Contact
So it has become equal here; there is no problem at all.
Everything is perfectly fine here.
But let me tell you one thing
As I have written Full Name here
I'll give it a space from the letter.
In place of Contact
Just Contact? Contact Address
Okay compatibly?
Now I'm selecting it.
I'm hitting it now.
So, you see
Something had to happen.
Hey, look here — what do you see?
Syntax Error
At Our Near Name
Select Name as Full Name
Email As Whatever It May Be
Syntax Error is showing
So what's going on here?
I will tell you.
When you are using this kind of SELECT query
When you are using alias
When you wrote it in this way
This name is a flower
It has taken the flower, after all.
Instead of a name, I'll show you flowers
What is this name doing again?
But we are talking about this one
Alysis is the name I wanted to change it to instead.
Because the flower name didn't feel good to me all at once
I want this face in between them.
It's simple, isn't it?
What will you do?
You will give it double quotes
If there is this face in between them
When you're giving the alien name
And if this face is in between them
Then you will have to use double quotes.
And this is why it is appearing before you now.
Because we were just running it
But now let's run it back.
And at this moment, it will become your turn.
And you will get your data back.
Look here, right here
At this time, we have this flower name.
And we have this contact address.
So you've seen it
How to select
Even a base practice was seen in Elias.
If you are using double words
And if there is space between them
Then you have to use double quotes
Not even single quotes
I will tell you.
Not even single quotes
Syntax error at or near fullness
When you show me
It will have to be paid
When you give single quotes
This data
Your value is
As students or computer science majors we are
Put double quotes
It has value
I've seen a little value.
I just wanted to give it a name, the value is a bit low, that's all.
Nem is an alias name.
Name column, so this will also be a column, double codes
You need to keep in mind these small little things.
Because mostly I have seen
When we code, write double code, single code there
It doesn't matter so much.
Ante line unless both of you
I mean, in one line, both double code and single code are coming for you.
Then there's a little problem, otherwise it wouldn't happen.
You need to provide the double code C here
Do not provide a single code.
Simple
Alright, that's done. Let me just run it once.
So that the error disappears from there
Alright, that's fine, no problem.
I mean, you said you're bulling, that your system is
You run toward me.
You will receive 100 out of 100 data today
I don't even feel the need to speak to you.
You will receive the complete 100 data of the roll today.
Now what can be known?
Exactly 90 days ago
In 84, go to
We had kept a separate role.
More than one lux of data
A lux from thick
200 before
A private luxury car will arrive today.
It is said somewhere that this is a matter of concern.
Your one lux is excellent
You'll go crazy.
That address, that is
This is it.
Show it to me
Write this down
Just dodge it, it's fine here—just dodge it, and now hit it and see what comes out. So, three two one and boom, guys, look—this is exactly what I wanted. I'm done, I've figured it out. Good, it came out. I only have three rolls in me, that's all.
Philal, now from this Fundart Record, the Hundred Court, I need to see you tomorrow in the case, if you have more data than my records, then there will be a clear indication of this there, so speak up and take it from those records, some of those roles were yours, now yours
There are many things, but we haven't even seen them yet.
That's in the select query, isn't it? We'll see it in the next video, but today
If you need this individual column here, it's not important, and before stating the wow factor, you could have easily done it very easily, and it's not about whether you need it or not—I'm just saying.
What should I do then?
Look, you see from the cowshed
Now, what's important for you here is this
Yeah? Because I've written double codes here
Because I had to treat him like a column.
Now I'm saying here that I need all the records in the users table.
But if this condition matches then
Yeah? Now, where equals what?
Where are you directly equal to?
Yeah? Whether he's a professor or someone from the professor's side, let's just check it out.
What is it? A certain professor, not a common one
I run this one.
Alright, Professor
Is there a spelling mistake again?
Where did the mistake happen, brother?
Yeah, okay, see?
Where am I? Look, I've explained this so clearly to all of you, and yet I'm the one who made the mistake.
And that is the brother's value, isn't it?
The column is short, professor, it's just a value, just data.
Single quotes, well, it's for the best anyway
Look here, the data has arrived, hasn't it?
Look here, I've got the data now
But only see their data, who are professors
Just professors, I mean those whose role is now solely that of professors.
I found their data here, Roll, just professors, look here, found it
Otherwise, we have an admin, we also have students.
But only professors, right?
We've seen all this, haven't we? See how much Select can do.
Now become a wow factor, just as I told you
The college management has finally decided
Whatever fees are applicable for your course now
Basically, Tek's now want to add that ad.
So you want to be in Thalst Databas, you're moving forward
I mean, you now want him to be selective about how much you can afford.
How much do you want this selection for? Okay?
Well, now you tell us, isn't this Yusfoo?
If you haven't liked the video yet, after seeing this,.gender, you must have felt it
Yeah, bro, you're right.
And by the way, there's one thing that comes to my mind
Courses, which are
Look here, I'll also file this thing for you.
The courses, I've got them
As I was using your user yesterday, the import
Actually, I have imported it.
Title, fee, and so we have this instructor ID
Here you can see, okay
I'll do one thing quickly for you guys,
Select, Start, Form, Courses, OK
I'm running it, look here, less jung, look here
So the ID is, the title is, the fee is, the instructor ID is
Advanced, Nejist, Architecture, Data Structure, Insi Plus Plus, Poscreas, Bootcam, Mansstek, Mastery, Machine Learning
These are all our courses, and these are their fees.
Instructor ID, all the IDs of those who are teaching them
What exactly has happened here, that we've added a 13% tax?
The government's new rule is that you will have to pay the fee, okay
How will it be speaking, selecting, what will you feel here?
Title, okay, so you'll get the fee, and I've given him a good alias
Here I'm giving you the league fee, base fee, or, okay, what exactly does base fee mean?
Then, regarding the new fees, the updated fees, what will they be for him, okay?
So the title, which lets you know, Let's Foolspeak Class, or course, whatever the fee was, Let's 5000, now I'm going to do here, whatever the fee is, fee is fee, fee is fee, okay, fee, what happened, 13% increase
Where from, courses, okay, in this way
When I saw that the spelling we've done is correct, no problem, okay, so let's move on here, I've done the fees
The price has increased; this was the fee, now it has become the fee itself. So understand this: I obtained Hari's data through a Y query, confirming that yes, the fee has increased, and the 13% tax has also increased. I've already displayed it here. Now it's become easy for me to know what belongs to whom and what doesn't. Now I...
What's lying with me is your task for today, okay? This is your task. And when you run this query, you'll see what output you'll get, okay? I'll handle all of this myself, okay?
And there's one more task for you. If I go ahead and do this here, we've already seen the Allite, so I've also kept the best practices here for you. Please go through them carefully. I've included both single and double ones here as well.
Look here, when we had followed the math guy, what's written here—these are the follow-up board masses, or Pamdas, board mass—you must know what board mass is, right? So, keep this in mind: you need to do the plus first. Now you must first add it, whatever it is...
What do you mean, even Bantari can't speak? When you say "expansion" or "expansion," we can say it. When you write it, if you put it inside double quotes, its priority increases, or this comes first...
And there are many such things remaining.
Just keep that in mind and apply.
That's all I wanted to say, okay
And here for you people
I have also provided practice questions.
So please go through this as well.
the contact list
Discover the departments, the welcome message
what to retrieve
name, email, and is active
columns from the users table
but alias them as this
You understand, you need these three, but you
You need to use the alias; this is what you're naming it.
discover the department
You need to discover the department.
We have users assigned to the different departments.
write the query to find
clean list of all unique departments
ID numbers currently in use
inside the users table
And you have to do the welcome message one.
It's a joke, read it happily.
I have kept this for you all, so that it may be for you all.
And better practice, and for you all
You can do this in a better way.
It is this, that is it.
You don't have the filth, and you were supposed to go to the park.
When then went to it
I'm talking about this damn fool
Growing up with friends
They are performing the copper ritual.
You are pricking it.
See you later, better than ever
For this, I will do something for you. I will do it for you.