Write and run sql statements to complete the given tasks

Assignment Help PL-SQL Programming
Reference no: EM131839452

Assignment

Instructions for using SQLite:

• 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

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

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;

Attachment:- Layout-Table-Horse.rar

Reference no: EM131839452

Questions Cloud

Why project management has become such popular business tool : What are some of the principal reasons why project management has become such a popular business tool in recent years?
Medicare and medicaid reimbursement systems : List and describe two types of Medicare and Medicaid Reimbursement Systems. Include how the systems differ from one another.
Components of the revenue cycle : Name and discuss in order the components of the revenue cycle. Which processes for revenue cycle management and reporting
What key characteristics do all projects possess : Describe the basic elements of a project life cycle. Why is an understanding of the life cycle relevant for our understanding of projects?
Write and run sql statements to complete the given tasks : Write and run SQL statements to complete the following tasks. Show the CUS_CODE of the customers for whom we DO NOT have invoices.
What is the flu : What is the flu? Influenza is a virus, should antibiotics be taken to treat the flu or a cold? Why, or why not?
Gap harvesting its own healing powers : If a person had bone lengthening completed after the growth plates have closed would the procedure still be successful.
Define criteria for successful IT projects : Consider the six criteria for successful IT projects. Why is IT project success often so difficult to assess? Make a case for some factors being more important.
Challenges and opportunities regarding risk management : Looking for peer reviewed and online academic resources involving the Challenges and opportunities regarding risk management as it relates

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd