Great Deal! Get Instant $25 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Query and update databases using SQL</o:p> Value: 15%</o:p> Due date: 08-Oct-2017</o:p> Return date: 27-Oct-2017</o:p> Submission method options </o:p> Alternative...

Query and update databases using SQL

Value:15%

Due date:08-Oct-2017

Return date:27-Oct-2017

Submission method options

Alternative submission method

Task

NOTES

  • This assignmentrequires you to use SQLite to complete the tasks listed below.
  • For guidance on how to install SQLite, watch this short YouTube video:https://www.youtube.com/watch?v=9ynCDVg54H0
  • For guidance on how to create tables using SQLite, watch this short YouTube video:https://www.youtube.com/watch?v=kij5lPw0F-o
  • Typing the SQL statements or the results is NOT acceptable.

Instructions

From Resources under Main Menu in Interact 2 go to Assignment 5 Folder

Copy sqlite3.exe file from theAssignment 5 Folder into a folder in your machine

Copy a5.txt from the Assignment 5 Folder into the folder in your machine where your SQLite file is located

From the SQLite Command Promptexecute the a5.txt script. To do this,at the SQLite Command Line type .read a5.txt [to create the tables you will use to answer this assignment’s questions]

At the SQLite Command Line type .headers on

At the SQLite Command Line type .mode column

Write and run SQL statements to complete the following tasks

  1. Show sums of line totals for each invoice.
  2. Locate the record in the vendor table that does not have a value for the attribute V_STATE
  3. Find the customers whose balance is greater than 200 but less than 300.
  4. Using natural join and having, list the customers whose invoice total is greater than 200
  5. Show the names of the customers for whom we have invoices.
  6. Using natural join and having, list the customers whose invoice total is greater than the average
  7. Show the names of the customers for whom we DO NOT have invoices.
  8. Using natural join and having, list the customers whose invoice total is the maximum.
  9. List thefirst name and last nameof the customers and how many times a customer has generated an invoice.
  10. List all purchases by customer 10018.
  11. List the names of the vendors who provided products.
  12. Using inner join, list the details of the products which sold more than 10 units.

You are required to submit:

1.The SQL statements for each query, which should be copied from your SQLite3 Command Line and pasted into your submission file.Ifyoutype .echoon at the SQLite3 Command Line, SQLite will output yourSQL statement with the results of the query making it easy to copy and paste both.

2.The screenshots of the results of the SQL statements which are to be copied from your SQLite3 Command Line and pasted into your submission file immediately after you execute the SQL query.If you used an output file please submit only the output file.

Rationale

This assessment aligns with the following subject outcomes:

  • be able to critically analyse and modify an existing database design to meet new business requirements;

Marking criteria

Each task is worth1.25 marks. The marking criteria for this assignment is:

Criteria

HD

DI

CR

PS

be able to critically analyse and modify an existing database design to meet new business requirements;

SQL syntaxreturnsall attributes that meet the business requirement from the tables that hold the data and appliesthecorrect restrictions to retrieve the required information.

SQL syntax returns all attributes that meet the business requirementfrom the tables that hold the data with minor omissions and applies appropriate restrictions to retrieve the required information.

SQL syntax returnskey attributes that meet the business requirementfrom the tables that hold the data and applies relevant restrictionsto retrieve the required information.

SQL syntax returnskey attributes that meet the business requirement from the tables that hold the data butthe restrictions applied to retrieve the required information containminor errors.

Oct 05, 2017
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here