Assessment Part A: (10 MARKS)
From Resources under Main Menu in Interact 2 go to Assignment 5 Folder
• This assignment requires you to use SQL Workbench to complete the tasks.
Instruction sheet on how to install SQL Workbench will be placed under ‘student resources’ on Interact2.
• You will need to download and use the file ‘Assignment5’, from Interact2 Student Resources in the ‘Assignment 5 – SQL DB’ folder.
• Queries need to have the correct syntax and must show the results after execution:
Typing the SQL statements or the results is NOT acceptable.
Write and run SQL statements to complete the following tasks
1. List the names and codes of vendors and the number of products each vendor has supplied, i.e. vendor AA has supplied xxx products, and vendor BB has supplied yyy products etc.
2. Show the total value of invoices for each customer with the customer the Last Name, and a column heading showing ‘Total_invoice_value’ in the results.
3. List the names of the customers and how many times a customer generated an invoice: make sure the new column heading reads “Num_Of_Invoices”.
4. Through a calculation, show the Total unit price (aliased column) for the units and line price.
5. Show the details of the invoice that has the minimum subtotal.
6. List all the purchases made by customer Orlando. (use a natural join).
7. Add a new vendor row/record in the vendor table and use your teacher’s name and your choice of other details. (1m)
8. Add a new row/record to the `customer` table to include your actual student_ID in the CUS_CODE, your last_name as the CUS_LNAME` and your first name as CUS_FNAME. Add any other details of your choice in all the other fields.
9. Add a new attribute (field) ‘Customer_rating’ with data type and length ‘VARCHAR(14) to the vendor table.
10. Update ‘Customer_rating’ for the Customer that has ‘your student ID and name’ from point 2, to show ‘GREAT’.