Jannatul Ferdaous
Jannatul Ferdaous

Reputation: 17

What is the use case of VIEW in SQL?

I know how to create and use view but struggling with it's use case, in real projects where do sql view fits?

**Create a view: **

CREATE VIEW [Products Above Average Price] AS
SELECT ProductName, Price
FROM Products
WHERE Price > (SELECT AVG(Price) FROM Products);

**use a view: **

SELECT * FROM [Products Above Average Price];

Upvotes: 0

Views: 20

Answers (0)

Related Questions