Reference no: EM132379055
Assessment - Query databases using SQL
Task
Task: Complex SQL Queries
Instructions
From Resources under Main Menu in Interact 2 go to Assignment 4 Folder
Copy sqlite3.exe file from the Assignment 4 Folder into a folder in your machine
Copy a4.txt from the Assignment 4 Folder into the folder in your machine where your SQLite file is located
From the SQLite Command Prompt execute the a4.txt script. To do this, at the SQLite Command Line type .read a4.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 (Each Query : 1.5 (0.75 query+ 0.75 for screenshot) Marks)
1. Show sums of line units for each invoice.
2. Show the details of the products that do not have a value for the attribute v_code.
3. Show the details of the invoices whose subtotal is greater than 24 but less than 76.
4. Show the details of the invoice who has the minimum subtotal.
5. Show the codes and names of the vendors who supplied products.
6. Using EXCEPT show the codes of the vendors who did not supply any products.
7. Using ‘NOT IN' show the codes and names of the vendors who did not supply any products.
8. List the names and codes of vendors and the number of products each vendor has supplied, i.e. vendor XXX has supplied xxx products, and vendor YYY has supplied yyy products etc.
9. Show the details of the employees who are located in area code 615.
10. Using inner join, list the details of the products whose line price is greater than 99.
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. If you type .echo on at the SQLite3 Command Line, SQLite will output your SQL 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.
Attachment:- Database Systems.rar