Skip to content

Commit

Permalink
updates queries to use northwind
Browse files Browse the repository at this point in the history
  • Loading branch information
luishrd committed Nov 6, 2019
1 parent 9092e41 commit 9adbb88
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@

For this lab you will

- write SQL statements against a pre-populated database using an online tool. Once you have the correct SQL Statement for each query, write it inside the queries.md file under the appropriate heading.
- write SQL statements against the `northwind.db3` database. Once you have the correct SQL Statement for each query, write it inside the _queries.sql_ file under the corresponding comment.
- write the db helper methods for the `schemes` resource in `./schemes/scheme-model.js`

### Multi Table Queries

Visit [SQL Try Editor at W3Schools.com](https://www.w3schools.com/Sql/tryit.asp?filename=trysql_select_top) using the **Google Chrome (or Chromium if you use Linux) browser** and write _SQL queries_ for the following requirements:
Use a graphical tool like `SQLite Studio` to open `./data/northwind.db3` and execute the following queries:

- Display the ProductName and CategoryName for all products in the database. Shows 76 records.
- Display the OrderID and ShipperName for all orders placed before January 9, 1997. Shows 161 records.
- Display all ProductNames and Quantities placed on order 10251. Sort by ProductName. Shows 3 records.
- Display the OrderID, CustomerName and the employee's LastName for every order. All columns should be labeled clearly. Displays 196 records.
- Display the ProductName and CategoryName for all products in the database. Returns 77 records.
- Display the order Id and shipper CompanyName for all orders placed before August 9 2012. Returns 429 records.
- Display the name and quantity of the products ordered in order with Id 10251. Sort by ProductName. Returns 3 records.
- Display the OrderID, curstomer's Company Name and the employee's Last Name for every order. All columns should be labeled clearly. Returns 16,789 records.

### Database Methods

Expand Down
13 changes: 0 additions & 13 deletions queries.md

This file was deleted.

9 changes: 9 additions & 0 deletions queries.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- Multi-Table Query Practice

-- Display the ProductName and CategoryName for all products in the database. Shows 77 records.

-- Display the order Id and shipper CompanyName for all orders placed before August 9 2012. Shows 429 records.

-- Display the name and quantity of the products ordered in order with Id 10251. Sort by ProductName. Shows 3 records.

-- Display the OrderID, Customer's Company Name and the employee's LastName for every order. All columns should be labeled clearly. Displays 16,789 records.

0 comments on commit 9adbb88

Please sign in to comment.