0% found this document useful (0 votes)
10 views

50 Practice Queries

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

50 Practice Queries

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

50 Practice Queries

Note: Assume a database named Northwind and tables and columns as per requirement of
question.

1. Create a report that shows the CategoryName and Description from the categories table
sorted by CategoryName.
2. Create a report that shows the ContactName, CompanyName, ContactTitle and Phone
number from the customers table
sorted by Phone.
3. Create a report that shows the capitalized FirstName and capitalized LastName renamed as
FirstName and Lastname
respectively and HireDate from the employees table sorted from the newest to the oldest
employee.
4. Create a report that shows the top 10 OrderID, OrderDate, ShippedDate, CustomerID, Freight
from the orders table sorted
by Freight in descending order.
5. Create a report that shows all the CustomerID in lowercase letter and renamed as ID from the
customers table.
6. Create a report that shows the CompanyName, Fax, Phone, Country, HomePage from the
suppliers table sorted by the
Country in descending order then by CompanyName in ascending order.
7. Create a report that shows CompanyName, ContactName of all customers from ‘Buenos
Aires' only.
8. Create a report showing ProductName, UnitPrice, QuantityPerUnit of products that are out of
stock.
9. Create a report showing all the ContactName, Address, City of all customers not from
Germany, Mexico, Spain.
10. Create a report showing OrderDate, ShippedDate, CustomerID, Freight of all orders placed
on 21 May 1996.
11. Create a report showing FirstName, LastName, Country from the employees not from United
States.
12. Create a report that showsthe EmployeeID, OrderID, CustomerID, RequiredDate,
ShippedDate from all orders shipped later
than the required date.
13. Create a report that shows the City, CompanyName, ContactName of customers from cities
starting with A or B.
14. Create a report showing all the even numbers of OrderID from the orders table.
15. Create a report that shows all the orders where the freight cost more than $500.
16. Create a report that shows the ProductName, UnitsInStock, UnitsOnOrder, ReorderLevel of
all products that are up for
reorder.
17. Create a report that shows the CompanyName, ContactName number of all customer that
have no fax number.
18. Create a report that shows the FirstName, LastName of all employees that do not report to
anybody.
19. Create a report showing all the odd numbers of OrderID from the orders table.
20. Create a report that shows the CompanyName, ContactName, Fax of all customers that do
not have Fax number and sorted by ContactName.
21. Create a report that shows the City, CompanyName, ContactName of customers from cities
that has letter L in the name
sorted by ContactName.
22. Create a report that shows the FirstName, LastName, BirthDate of employees born in the
1950s.
23. Create a report that shows the FirstName, LastName, the year of Birthdate as birth year
from the employees table.
24. Create a report showing OrderID, total number of Order ID as NumberofOrders from the
orderdetails table grouped by
OrderID and sorted by NumberofOrders in descending order. HINT: you will need to use a
Groupby statement.
25. Create a report that shows the SupplierID, ProductName, CompanyName from all product
Supplied by Exotic Liquids,
Specialty Biscuits, Ltd., Escargots Nouveaux sorted by the supplier ID
26. Create a report that shows the ShipPostalCode, OrderID, OrderDate, RequiredDate,
ShippedDate, ShipAddress of all orders
with ShipPostalCode beginning with "98124".
27. Create a report that shows the ContactName, ContactTitle, CompanyName of customers
that the has no "Sales" in their
ContactTitle.
28. Create a report that shows the LastName, FirstName, City of employees in cities other than
"Seattle";
29. Create a report that shows the CompanyName, ContactTitle, City, Country of all customers
in any city in Mexico or other
cities in Spain other than Madrid.

You might also like