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

Task NOTES 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...

1 answer below »
Task

NOTES

  • 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.
  • Students can also use SQLite listed below, 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=9ynCDVg54H0https://www.youtube.com/watch?v=9ynCDVg54H0https://www.youtube.com/watch?v=9ynCDVg54H0
  • Typing the SQL statements or the results is NOT acceptable.
  • 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. Show the details of the products where the product code starts with '22'.
2. Display the vendor details from areacode 615.
3. Find the balance for customer 'George Williams'.
4. Show the number of products from each vendor and display the vendor code if there are more than 2 products from the same vendor.
5. Display the vendor code, name, phone number and the number of products from each vendor.
6. Find the customers whose balance is zero.
7. List the name of the customers for whom we have invoices.
8. Show the name and cus_code of the customers for whom we DO NOT have invoices.
9. Find out how many times a customer generated an invoice.

Part B - DDL

1. Add a new attribute email_address varchar(30) to the customer table.
2. Add email_address = ' XXXXXXXXXX' for customer '10016'.
3. Delete the record for employee Edward Johnson from EMP table.

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 criteriaThe marking criteria for this assignment is:

HDDICRPSFL
Accurate and elegant SQL that answers all parts of the question. SQL code copied from SQLite as well as a screen shot of code and results into the submission fileGood SQL that answers most parts (75% ~ 85%) of the question. SQL code copied from SQLite as well as a screen shot of code and results into the submission fileSatisfactory SQL that answers some parts (65% ~ 75%) of the question. SQL code copied from SQLite as well as a screen shot of code and results into the submission filePartial SQL that answers a small part (50% ~ 65%) of the question. SQL code copied from SQLite as well as a screen shot of code and results into the submission fileIncomplete or irrelevant SQL that does not answer the question (

Presentation

This assessment item is required to be submitted in Word format (.doc, or .docx).
All SQL statements should be copied from SQLite into the word document. All screenshots that are required should be captured and inserted into the document in the appropriate position to show that you have completed the requirement.
Screenshots that are submitted in addition to the assignment document will not be marked. Databases must not be included as part of a submission.

Requirements

Either submit your assignmentasa Word document.

Don't use any other file formats.

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

Answered Same Day May 09, 2020 ITC556 Charles Sturt University

Solution

Ujjawal answered on May 12 2020
162 Votes
DML Queries
1. Show the details of the products where the product code starts with ‘22’.
Solution: SELECT * FROM PRODUCT WHERE P_CODE LIKE ‘%22’;
2. Display the vendor details from area code 615.
Solution: SELECT * FROM VENDOR WHERE V_AREACODE =’615’;
3. Find the balance for customer ‘George Williams’.
Solution: SELECT CUS_BALANCE FROM CUSTOMER WHERE CUS_FNAME = ‘George’ AND CUS_LNAME = ‘Williams’;
4. Show the number of products from each vendor and display the vendor code if there are more than 2 products from the same vendor.
Solution: SELECT * FROM (SELECT * FROM PRODUCT GROUP BY V_CODE HAVING COUNT(V_CODE) >...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here