Question
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:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started