Database Reference
In-Depth Information
Figure 7-18
result of SELECt on
CustomerInterestsView
write an SQL statement on that view that uses the computed variable in a WHERE clause. To
understand this, consider the SQL view definition for the ArtistWorkNetView:
/* *** SQL-CREATE-VIEW-CH07-06 *** */
CREATE VIEW ArtistWorkNetView AS
SELECT LastName AS ArtistLastName,
FirstName AS ArtistFirstName,
W.WorkID, Title, Copy, DateSold,
AcquisitionPrice, SalesPrice,
(SalesPrice - AcquisitionPrice) AS NetProfit
FROM
TRANS AS T JOIN WORK AS W
ON
T.WorkID = W.WorkID
JOIN ARTIST AS A
ON W.ArtistID = A.ArtistID;
Search WWH ::




Custom Search