Database Assessment Questions Revised PDF
Database Assessment Questions Revised PDF
Worth: These exercises are worth 20% of the marks for COMP 636
Exercise Preparation
Download the northwind.sql and northwind-data.sql file from the COMP636 Learn@Lincoln site.
Load the northwind database and then the northwind-data.sql into your AWS RDS MySQL
Environment, note that these scripts may take 15 mins to execute.
The script creates a database with the tables and relationships shown below, it also loads data into
the tables. A larger version of this schema is provided as a PDF download also.
For each of the questions below, create and execute a query to return the information requested.
In the answer document, place the SQL for the query along with the number of rows returned when
it is executed or the actual rows returned depending on the question (requirement indicated on
answer sheet)
1. List all the orders that contain discontinued products.
2. The number of purchased orders placed with each supplier. The result should show the
company name and the number of orders placed.
4. All of the products where the units on order are less than the re-order level
5. A list of all the unique product_names (Product) supplied by each company (suppliers)
9. List the total quantity of products that are purchased, sold or on hold (transaction type).
Output the product ID, Quantity and Transaction Type
10. Identify the employee who places the largest number of purchase orders.
Question 4 - A product is on order where there is a purchase_order_detail entry that does not have a
date_received set.
Question 5 - This should for each supplier list the products they supply. This needs to be determined
from products, purchase_order_details, purchase_orders & suppliers. Do not use supplier_ids in the
products table.
Question 6 & 7 - The value of each purchase order needs to be calculated from the
purchase_order_details table not the payment _amount in the purchase_orders table.
Question 10 - The employee placing the purchase_order is the one identified in the 'created_by' field.
Mark Allocation
Question Number Marks Allocated
1 1
2 2
3 1
4 2
5 2
6 4
7 4
8 3
9 4
10 2
Submission:
Use the Answer Sheet provided on the COMP636 Learn @ Lincoln site to record your answers.
Upload this sheet via the submission link on the COMP 636 Learn @ Lincoln site.
The final submission time for these exercises is 5pm on 15th January 2021.