Create a view named customer_addresses that shows the shipping and billing addresses for each customer. This...

90.2K

Verified Solution

Question

Programming

Create a view named customer_addresses that shows the shippingand billing addresses for each customer. This view should returnthese columns from the Customers table: customer_id, email_address,last_name and first_name. This view should return these columnsfrom the Addresses table: bill_line1, bill_line2, bill_city,bill_state, bill_zip, ship_line1, ship_line2, ship_city,ship_state, and ship_zip.

I have this

CREATE VIEW customer_addresses AS

SELECT customer_id, email_address, last_name, first_name,
bill_line1, bill_line2, bill_city, bill_state, bill_zip,
ship_line1, ship_line2, ship_city, ship_state, ship_zip

FROM Customers, Addresses

WHERE Customers.customer_id = Addresses.customer_id

ORDER BY last_name, first_name;

Error Code: 1052. Column 'customer_id' in field list isambiguous

Answer & Explanation Solved by verified expert
3.6 Ratings (396 Votes)
Changes to be made i Error Code 1052 means SQL cannot read or support customerid It means SQL dont know from where to choose customerid column either from Customers table or    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students