Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hint: If any string value you need to specify has an apostrophe in it, put in two apostrophes where the one would be. This is

Hint: If any string value you need to specify has an apostrophe in it, put in two apostrophes where the one would be. This is because apostrophes are how strings are started and finished and the computer needs to be told that the apostrophe is not the end of the string, but part of the string. For example, in the first question, if your last name is O 'Malley, the value in your statement would be communicated as: 'O ' 'Malley '

Hint: If for any of the following questions you are instructed to provide no value, then you can either leave the column out of the statement or explicitly state NULL for that columns value. Noting that NULL never goes inside apostrophes.

1.) Write a single, simple INSERT statement for the employees table that:

Adds one row with an employee_id of 10, a department_number of 5, your last name, your first name, and no manager_id

2.) Write a single, simple INSERT statement for the invoices table that:

Adds one row with a vendor_id of 123, an invoice_number of 5150_2112, an invoice_date of todays date, an invoice total of 555.66, a payment_total of 0.0, a credit_total of 0.0, a terms_id of 3, an invoice_due_date of 30 days after todays date, and no payment_date.

Note that this table also has an invoice_id column, but you dont want to specify a value for that column. It will be automatically generated for you.

3.) Write a single, simple INSERT statement for the items table that:

Adds one row with an item_id of 11, a title of 'Balance', an artist of 'Van Halen', and a unit_price of 9.99.

4.) Write a single, simple INSERT statement for the order_details table that:

Adds one row with an order_id of 829, an item_id of 11, and an order_qty of 5.

For the remaining questions, you will always need a WHERE clause. You can create any WHERE clause you want that achieves the stated objective. However, I would suggest paying attention to each tables main id column and use that in your WHERE clause. For example, the WHERE clause to change or remove a record from the employee table with an employee_id of 13 would be:

WHERE employee_id = 13

5.) Write a single, simple UPDATE statement for the employees table that:

For the row you added in question 1, change the department_number to 2.

6.) Write a single, simple UPDATE statement for the invoices table that:

For the row you added in question 2, change the payment_total to 555.66 and the payment_date to todays date.

7.) Write a single, simple UPDATE statement for the items table that:

For the row you added in question 3, change the unit_price of to 8.99. (Its a great album and its on sale!)

Hint: For question 8, you will need a WHERE clause with two conditions. order_id 829 has several items on it and we only want to change the row for item_id 11.

8.) Write a single, simple UPDATE statement for the order_details table that:

Since the album is on sale, why dont we order 2 more. For the row you added in question 4, change the order_qty to 7.

9.) Write a single, simple DELETE statement for the employees table that:

Removes the row you added in question 1.

10.) Write a single, simple DELETE statement for the invoices table that:

Removes the row you added in question 2.

11.) Write a single, simple DELETE statement for the items table that:

Removes the row you added in question 3.

Hint: For question 12, you will need a WHERE clause with two conditions. order_id 829 has several items on it and we only want to remove the row for item_id 11.

12.) Write a single, simple DELETE statement for the order_details table that:

Removes the row you added in question 4.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

What roles have these individuals played in your life?

Answered: 1 week ago