My answer for exercise 1 CREATE VIEW customeraddresses AS SE
My answer for exercise 1:
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 WHERECustomers. customer_id = Addresses.customer_id ORDER BY last_name, firstname;
2) Write a SELECT statement that returns these columns from the customer_addresses view that you created in exercise 1: customer_id, last_name, first_name, bill_line1.
3) Write an UPDATE statement that updates the addresses table. Set the line 1 address to “1990 Westwood Blvd.” for the customer with an ID of 8. Then check that the update is shown in the view.
thank you i apprecite your time and help
Solution
2) SELECT customer_id, last_name, first_name, bill_line1 FROM customer_addresses;
3) UPDATE customer_addresses SET bill_line1 = \'1990 Westwood Blvd\' WHERE customer_id=8;
