what is a view in sql
snippet in sql

how to create a view in sql

user5753


CREATE VIEW view_name AS

SELECT column1, column2, ...

FROM table_name

WHERE condition; 

what is a view in sql

user4878

In SQL, a view is a virtual table based on the result-set of an SQL statement.
A view contains rows and columns, just like a real table.
You can add SQL functions, WHERE, and JOIN statements to a view 
and present the data as if the data were coming from one single table.

-- syntax
CREATE VIEW view_name AS
SELECT column1, column2, ...
FROM table_name
WHERE condition;

create view

user5342

CREATE VIEW view_name AS SELECT id,category,MAX(created_at),content,title FROM table WHERE condition GROUP BY category

creating view in sql

user7081

The following SQL creates a view that shows all customers from Brazil:

CREATE VIEW [Brazil Customers] AS
SELECT CustomerName, ContactName
FROM Customers
WHERE Country = 'Brazil';