Using a View Display all records in view Use the view name where you would normally use a table Display all plant 1 union name in any query members SQL will combine the query that created the view with the query that uses the view. Discuss combined query CREATE VIEW vwCsBooks AS what really occurs SELECT * FROM tblbooks WHERE bookType=’CS’ bookTitle, bookPrice SELECT FROM vwCsBooks bookPrice > 25 WHERE ORDER BY bookPrice DESC; Behind the scenes, SQL would combine the SELECT clause of the CREATE VIEW command with the SELECT statement that uses that view to form the following SELECT statement: SELECT bookTitle, bookPrice FROM tblBooks bookPrice > 25 WHERE AND bookType= ‘CS’ ORDER BY bookPrice DESC; This combination occurs behind the scenes, the user never knows it’s happening.
Using a View Use the view name where you would normally use a table name in any query SQL will combine the query that created the view with the query that uses the view. CREATE VIEW vwCsBooks AS SELECT * FROM tblbooks WHERE bookType=’CS’ SELECT bookTitle, bookPrice FROM vwCsBooks WHERE bookPrice > 25 ORDER BY bookPrice DESC; Behind the scenes, SQL would combine the SELECT clause of the CREATE VIEW command with the SELECT statement that uses that view to form the following SELECT statement: SELECT bookTitle, bookPrice FROM tblBooks WHERE bookPrice > 25 AND bookType= ‘CS’ ORDER BY bookPrice DESC; This combination occurs behind the scenes, the user never knows it’s happening. Display all records in view Display all plant 1 union members Discuss combined query what really occurs