Assessment item 5Query and update databases using SQLValue:15%Due date:28-Jan-2018Return date:19-Feb-2018Submission method optionsEASTS (online) Task NOTES This assignmentrequires you to use SQLite to...

Assessment item 5Query and update databases using SQLValue:15%Due date:28-Jan-2018Return date:19-Feb-2018Submission method optionsEASTS (online)
Task


NOTES



  • This assignmentrequires you to use SQLite to complete the tasks listed below.Student can also use SQL Workbench or another software (if they are familiar) to complete the tasks.

  • 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 for using SQLite:




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

  • Copy sqlite3.exe and cmd.exe files from the Assignment 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 Prompt execute 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







Assignment 5 tasks:each query is worth 5 marks

Write and run SQL statements to complete the following tasks


Part A - DML




  1. Locate the record in the vendor table that does not have a value for the attribute V_STATE

  2. Find the customers whose balance is greater than $300 but less than $400.

  3. Show the names of the customers for whom we have invoices.

  4. What is the max balance?

  5. Show the CUS_CODE of the customers for whom we DO NOT have invoices.

  6. Show the names of the customers for whom we DO NOT have invoices.

  7. Find out how many times a customer generated an invoice – make sure the counted column heading reads “Invoices_generated”.

  8. List the names of the customers and how many times a customer generated an invoice – make sure the counted column heading reads “N_Of_Invoices” .



Part B - DDL



  1. 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 firstname as CUS_FNAME. Add any other details of your choice in all the other fields.

  2. Add a new attribute (field) credit_history VARCHAR(6) to the customer table.

  3. Update credit_history for customer '10011' to 'Bad'.

  4. Delete the employee Leighla Genkazi from the EMP table.

  5. Add a new attribute called ‘email_address’ to ‘emp’ table with data type and length ‘VARCHAR(20).



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

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.

Requirements


Either submit your assignmentasa PDFora Word document.


Don't use any other file formats.


Please include your student ID, name and subject code in your submission.

Jan 15, 2020
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here