Exercise 3

You can ignore Question 1 and Question 2 if you already have Northwind database loaded.

  1. Create a Database named northwind.

  2. Download the SQL file from this link and run the code present in it inside the northwind database. (Make sure that the tables are created inside northwind database only)

  3. Select the contact name, customer id, and company name of all Customers in London

  4. Select all available columns in the Suppliers tables that have a FAX number.

  5. Select a list of customers id’s from the Orders table with required dates between Jan 1, 1997 and Jan 1, 1998 and with freight under 100 units.

  6. Select a list of company names and contact names of all the Owners from the Customer table from Mexico, Sweden and Germany.

  7. Count the number of discontinued products in the Products table.

  8. Select a list of category names and descriptions of all categories beginning with 'Co' from the Categories table.

  9. Select all the company names, city, country and postal code from the Suppliers table with the word 'rue' in their address. The list should be ordered alphabetically by company name.

  10. Select the product id and the total quantities ordered for each product id in the Order Details table.

  11. Select the customer name and customer address of all customers with orders that shipped using Speedy Express.

  12. Select a list of Suppliers containing company name, contact name, contact title and region description.

  13. Select all product names from the Products table that are condiments.

  14. Select a list of customer names who have no orders in the Orders table.

  15. Insert a new shipper named 'Amazon' to the Shippers table using SQL.

  16. Change the company name from 'Amazon' to 'Amazon Prime Shipping' in the Shippers table using SQL.

  17. Select a complete list of company names from the Shippers table. Include freight totals rounded to the nearest whole number for each shipper from the Orders table for those shippers with orders.

  18. Select all employee first and last names from the Employees table by combining the 2 columns aliased as 'DisplayName'. The combined format should be 'LastName, FirstName'.

  19. Select a list of products from the Products table along with the total units in stock for each product. Give the computed column a name using the alias, 'TotalUnits'. Include only products with TotalUnits greater than 100.

Last updated