|
Execute the following
script in Query Analyzer to create the views:
CREATE VIEW [LowPriceProducts]
AS
SELECT ProductName,UnitPrice
FROM Products
WHERE UnitPrice < 1.0 / 3.0 * (SELECT AVG(UnitPrice) FROM Products)
GO
SELECT * FROM LowPriceProducts ORDER BY ProductName
GO
CREATE VIEW [HighPriceProducts]
AS
SELECT ProductName,UnitPrice
FROM Products
WHERE UnitPrice > 2.0 / 3.0 * (SELECT AVG(UnitPrice) FROM Products)
GO
SELECT * FROM HighPriceProducts ORDER BY ProductName
GO
|