Create a view based on the MyCustomers table that lists the customer last name, first name and email. Do not include the customer# in the view. Name the view Contact. View the contents of the view.
/*
Assuming this is how MyCustomers table was generated;
*/
CREATE TABLE MyCustomers (
CustomerID int,
LastName varchar(255),
FirstName varchar(255),
Email varchar(255)
);
/*
the view
*/
CREATE VIEW Contact AS
SELECT LastName, FirstName, Email
FROM MyCustomers;
/*
Viewing all contents of the view
*/
SELECT * FROM Contact;
Comments
Leave a comment