Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Database Processing (14th edition); Author, Kroenke, David M and Seaman, Don F;

ID: 3863028 • Letter: D

Question

Database Processing (14th edition); Author, Kroenke, David M and Seaman, Don F; Chapter 7 7.40 Write an SQL statement to create a view named CustomerSalesView based on the the CUSTOMER 04 and SALE 02 tables. In this view, include the values of Customer ID, LastName as CustomerLastName, FirstName as CustomerFirstName, EmailAddress, SaleID, DateOfSale, and Sale Amount in that order. Run this statement to create the view, and then test the view by writing and running an appropriate SQL SELECT statement

Explanation / Answer

CREATE OR REPLACE VIEW CustomerSalesView AS
SELECT C.Customer_ID,C.LastName as CustomerLastName,C.FirstName as CustomerFirstName,C.EmailAddress,S.SaleID,S.DateOfSale,S.SaleAmount
FROM
CUSTOMER_04 C,SALE_02 S WHERE
C.Customer_ID=S.Customer_ID;

SQL statement to run this view:

select * from CustomerSalesView;