Hello there welcome.
In this video we will be limiting and then sold tindale to retrieve from a database.
Why do we need to limit data.
Well often databases and they tables can get very large and may require or searchers retrieving only
parts of the information from a table at a certain time.
Well we can achieve this using Eskew school so we use the select clause the WHERE clause and then be
ordered by to achieve the limiting and sorting of data.
Let's assume we've had a fictitious request from the boss's big company we work for and they have just
had a windfall and will like to give some cash.
We however do only one and give the cash to employees who earn less than twelve thousand dollars or
pounds in a year.
So they come to us as a database administrator or analyst to get that data for them.
So we are going to try and get that information from them.
I have got to add for a Editor open and I have written a script or rescue a query that will get the
information we require.
I just need to explain this query too.
So we start with the select statement and then we select the necessary columns from the Employees Table
so we select the employee I.D. the first name last name and salary.
You always separate the columns in the query by a comma.
So you put a comma after each column apart from the last column.
So we've got our columns here we've got the idea in the first name last name and then salary and then
in the From field we have to tell s cool where to get the information from which is the Employees Table.
Next we use the WHERE clause to field to that table.
We don't want all the data return from that table.
We only want setting data based on certain criteria.
The criteria we've set is that any one who has the summary less than twelve thousand dollars or pounds.
Those are the only details we want.
So it will return anyone who might use this criteria.
Ben wise you've got the data we now coming on the next you say order but we won't.
All we want the data to be filtered all sorted in salary order sorted by salary and then we won in the
descending order.
That is from top to bottom descending means we will start with a higher salary and filter down to the
lowest.
So now let's execute the query.
Always remember to end your queries with semi quinolone so executed that you will run Excel and so we've
got 98 people who matches that criteria.
So going to have 98 people who were going to get some kind of bullets in their salary right.
So what we do know is a salary is been sorted or ordered in descending order.
That's what is descending it will order in from top to bottom so you got 11.
Five hundred eleven hundred and then the lawyers is to 100.
That's quite low.
Okay so we've got the data.
How do we get this information to the bosses so to do that.
Go to.
They say it's export data set.
Click on that and then you can select the format.
Most people have got Excel so are set to excel.
And then here you give the file name.
So I've given the file salary.
So you will be saved onto my desktop or the rest you can leave as default.
And then click or key.
So if I look on my desktop now I should have a file cause salaries excel and see that.
This as a father so I can now send this far to the direct or the bosses based on this information the
day will issue bonuses to be relevant people bago So this is the data that I have export to exported
from the table database table.
All right so or so I can now send this to the boss in this vigil we limited day to using the word class
and all SOOL sorted data using the order by clause.
I hope the information individual has been helpful.
Thank you so much for watching.
Bye for now.