Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the given MyGuitarShop database to answer these questions. 100 points. 1. Create a view named Customer Addresses. a) This view shows the shipping and

image text in transcribed
Use the given MyGuitarShop database to answer these questions. 100 points. 1. Create a view named Customer Addresses. a) This view shows the shipping and billing addresses for each customer in the MyGuitarShop database by using the Customers and Addresses tables. This view should show these columns from the Customers table: CustomerID, Email Address, LastName and FirstName. This view should show these columns from the Addresses table: BillLinel, BillLine2, BillCity, BillState, BillZip, ShipLinel, ShipLine2, ShipCity, ShipState, and ShipZip. Hint: Join Customer table with the Addresses table once on BillingAddressID and once on ShippingAddressD. You must use aliases for the Addresses table. b) Write a SELECT statement that displays these columns from the Customer Addresses view that you created in exercise la: CustomerID, LastName, FirstName, BillLinel. c) Write an UPDATE statement that updates the CustomerAddresses view you created in exercise la so it sets the first line of the shipping address to "1990 Westwood Blvd." for the customer with an ID of 8. 2. Create a view named OrderltemProducts that displays the following columns from the Orders, OrderItems and Products tables Orders table: OrderID Order Date, TaxAmount, and ShipDate. OrderItems table: ItemPrice, Discount Amount, DiscountItemPrice, Quantity, and Item Total (Item Total takes into account Quantity). Products table: Product Name 3. Create a view named Product Summary that uses the view (OrderitemProducts) you created in exercise 2. Do not use the original tables for this view- you are writing a view based on another view. This view should show the following summary information about each product using aggregate functions and group by: Product Name OrderCount the total number of each product ordered) and Order Total (the total Item Total for each product). This view will not work unless you have created the OrderItemProducts view first 4. Write a SELECT statement that uses the view (ProductSummary) that you created in exercise 3 to display the three best-selling products based on OrderCount. This view will not work unless you have created the ProductSummary view first

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions