ORDER BY Clause Practice Problems PDF
ORDER BY Clause Practice Problems PDF
Sorting
Using
the
ORDER
BY
Clause
Practice
Problem
Solutions
Question
1:
SELECT
FirstName,
LastName,
JobTitle
FROM
HumanResources.vEmployeeDepartment
ORDER
BY
FirstName
ASC
Question
2:
SELECT
FirstName,
LastName,
JobTitle
FROM
HumanResources.vEmployeeDepartment
ORDER
BY
FirstName,
LastName
DESC
Question
3:
SELECT
FirstName,
LastName,
CountryRegionName
FROM
Sales.vIndividualCustomer
ORDER
BY
3
Question
4:
SELECT
FirstName,
LastName,
CountryRegionName
FROM
Sales.vIndividualCustomer
WHERE
CountryRegionName
IN
('United
States',
'France')
ORDER
BY
CountryRegionName
Question
5:
SELECT
Name,
AnnualSales,
YearOpened,
SquareFeet
AS
[Store
Size],
NumberEmployees
AS
[Total
Employees]
FROM
Sales.vStoreWithDemographics
WHERE
AnnualSales
>
1000000
AND
NumberEmployees
>=
45
ORDER
BY
[Store
Size]
DESC,
[Total
Employees]
DESC