SQL Views   «Prev 

Create and Update SQL View - Exercise

Objective: Create an updatable view, then write an UPDATE statement to modify a value through it.
Given the two tables below, create two separate updatable views, one on each table, then write an UPDATE statement through each view: one that changes a customer's last name, and one that changes a customer's phone number. Each view must include the table's primary key, since that's what makes a single-table view updatable in the first place. Include a WHERE clause in each UPDATE that identifies exactly one CustomerID; an UPDATE with no WHERE clause changes every row in the table.
Customers
CustomerID Lastname Firstname Address City State ZipCode

PhoneNumbers

CustomerID PhoneNumber