Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a view named CustomerAddresses that shows the shipping and billing addresses for each customer in the MyGuitarShop database. -This view should return these columns

Create a view named CustomerAddresses that shows the shipping and billing addresses for each customer in the MyGuitarShop database.

-This view should return these columns from the Customers table: CustomerID, EmailAddress, LastName and FirstName.

-This view should return these columns from the Addresses table: BillLine1, BillLine2, BillCity, BillState, BillZip, ShipLine1, ShipLine2, ShipCity, ShipState, and ShipZip.

-Use the BillingAddressID and ShippingAddressID columns in the Customers table to determine which addresses are billing addresses and which are shipping addresses.

*Hint: You can use two JOIN clauses to join the Addresses table to Customers table twice (once for each type of address).

Not sure why it asks for BillLine1, BillCity, etc because they are not even included in the columns for the database? I have asked my teacher but have yet to get a reply.

Here are the columns for both databases:

image text in transcribed

db0Addresses Columns AddressID (PK, int, not null) o CustomerlD (FK, int, null) Line! (varchar(60), not null) E Line2 (varchar(60), null) E City (varchar(40), not null) E State (varchar(2), not null) ZipCode (varchar(10), not n Phone (varchar(12), not null Disabled (int, not null) Keys Constraints Triggers Indexes Statistics EE dboAdministrators dboCategories dbo.Customers Columns CustomerlD (PK, int, not nu | EmailAddress (varchar(255) E Password (varchar(60), not r FirstName (varchar(60), not E LastName (varchar(60), not E ShippingAddresslD (int, null E BillingAddressID (int, null) db0Addresses Columns AddressID (PK, int, not null) o CustomerlD (FK, int, null) Line! (varchar(60), not null) E Line2 (varchar(60), null) E City (varchar(40), not null) E State (varchar(2), not null) ZipCode (varchar(10), not n Phone (varchar(12), not null Disabled (int, not null) Keys Constraints Triggers Indexes Statistics EE dboAdministrators dboCategories dbo.Customers Columns CustomerlD (PK, int, not nu | EmailAddress (varchar(255) E Password (varchar(60), not r FirstName (varchar(60), not E LastName (varchar(60), not E ShippingAddresslD (int, null E BillingAddressID (int, null)

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

=+4. What role do champions have in social media marketing? [LO-5]

Answered: 1 week ago

Question

=+3. How do emotional appeals differ from logical appeals? [LO-2]

Answered: 1 week ago