QuestionQuestion

1. Create a view named order_items that returns columns from the ORDERS, ORDERITEMS, and PRODUCT tables.
This view should return these columns from the ORDERS table: order_id, order_date, tax_amount, and ship_date.
This view should return these columns from the ORDERITEMS table: item_price,
discount_amount, final_price (the discount amount subtracted from the item price), quantity, and item_total (the calculated total for the item).
This view should return the product_name column from the PRODUCT Table.
Write a SELECT statement that returns all the columns from the order_items view.

2. Create a view that lists the product ID and product name for each product along with the first name and phone number of the person to contact if the product needs to be reordered. Name the view reorder_info.
Write a SELECT statement that returns all the columns from the reorder_info view.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

-- Create order_items view

CREATE VIEW order_items AS

select orders.order_id,orders.order_date, orders.tax_amount,orders.ship_date

,orderitems.item_price,orderitems.discount_amount,(item_price-discount_amount) as final_price,orderitems.quantity,(item_price-discount_amount)*quantity as item_total

,product.product_name

from Orders

inner join orderitems on orders.order_id = orderitems.order_id...

By purchasing this solution you'll be able to access the following files:
Solution.sql.

$10.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Database Development Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats