Hello and welcome.
Came this video we will be using the rescue ELDs cell lect command to read and filter data from a database
because Q Was there live.
Mine is the busiest off or the school commands.
It's the one you used.
Mostly cause it's the one you need to retrieve data from a database.
Is why you need to read relevant information from a database so the rescue select statement I would
see you would use almost 60 or 70 percent more than the other rescue a select command.
Ask you also what command all saw works with other parts of the obscure language.
It also works in combination with the WHERE clause they where clause is used to act as a filter to filter
the data that is returned by the select command.
All saw you have the order by the order by can be used to use the date that has been retrieve puts them
in some kind of sorting order.
So this has got the leg is used in combination with all the key words like the WHERE clause and the
Order barc.
So we are going to use it as glue a Select Tool or pull information out of a database and also use the
other clauses like the WHERE clause and the order by to field to the information that is returned from
the database.
We are going to use this select command to view data from the employees table the employees table is
a table in the char scheme so I have called or a call to add 24 hour edit or open.
Were going to use this to query and retrieve some information from the database table so to do that
you use the Select keyword you type in select and then hysterics Asterix means bring back all the columns
so bring back everything and then into a front.
You need to specify where you get the data from.
So are you from.
Will specified the table and the table name its employees
and they up with a semicolon.
So what.
This skill on combined this saying is that bringing back all the records from this table I want order
columns or the rows.
So by using this as serax here you are specify you want everything returned.
No data filter just bring back everything.
So fact execute.
This is was retimed everything from that table.
These are all the columns from the table and the tables got three hundred and seven rows in total.
So is back everything.
So the select statement can be used to retrieve data from a table.
But they can also be used to filter the information that is returned from the table.
You can also specify specific information you want and then bring back everything to do that you have
to use with clocks or write say we've had a request to find out how many employees earn more than twelve
thousand dollars or pounds a year.
So the seller let come out is what we'll use to get that information.
We also need to use the where clause to act as a filter so that we don't get all the data returned and
then we need to put data in some kind of order using the order by command.
So the data we need query we need to write this.
We do select.
We meet us.
Ify the column names so we wonder first name last name and salary.
All right so go first name.
Always write the columns the way they'll specify on the table.
This is the first name you see is caught on the score.
And then you separate the columns with a comma sort of first column his first name and the last name
as well here.
So you type your last name
comma and then next one salary.
All right you don't need a comma with a last column just the columns that precede that.
So I've got all the columns I want next.
I need to specify from what table table name is employees.
And then I need to add a to cause I don't want all the records returned.
So you use a where clause 2 and a filter where salary
remember the request was for data relating to people who earn more than 12000 Dulux.
So where's salary is greater.
This is doing great and downsizing this symbol here.
So where is salary is greater than 12000.
Okay.
So was this this was this daytime's return we need to filter it.
So you used the order by
order by salary
descending descending means once you returned the salary.
I want you to filter it or order it in a sense in descending order.
Now this from high to low.
All right.
We end this statement with a semicolon So the whole lot of this is known as Eskew will query or statement.
The entire block here highlighted is known as an obscure query or statement.
So now I can execute that and is giving me a total total of eight rules.
So there are eight people in this organization in the Employees Table that earn more than twelve thousand
dollars each year.
So I'll commit the day to comment that to date I now committed to the table.
So I've got this information so to export this information to someone else.
I just go to export data set.
You type in the name you give in the type of format so you can export it as an Excel file or hastier
mail any of this relevant.
Once I get weichsel I give in name of salary's and click balki.
So if I open my desktop I should have afford a cord sub.
So this is the spreadsheet that was extracted from the table so I opened this up.
And there you go.
So that's the dust the record of eight people who earn more than twelve thousand dollars.
So I can now email this spreadsheet to the finance director or wherever I requested that information.
So this is how you would retrieve data from the database.
So in this feed you.
We use this rescue us select key word command to retrieve data from a database table.
We all saw filtered data use in the where clause and then put the data in salary order in distending
way from high to low using the order by clause.
So it is.
By here you can order by any on the table columns more.
In this case I have ordered by the salary sense.
The salary is ordered in the order of specified descend in taxes from high to low.
I hold information in his view has been helpful.
So you should be able to use the as Google com said Let command to retrieve data from a database.
Thank you so much for watching.
Take care.
Bye for now.
TRAMP practice as much as you can.
Please feel free to contact me if you've got any issues relating to these.
Feed your course.
Thanks so much.
Bye for now.