Description

The SQL keyword CREATE VIEW is used to create a view, which is a virtual table based on the result set of an SQL statement.

The below SQL statement creates a view, containing all the customers from Spain.

CREATE VIEW [Spain Customers] AS
SELECT customer_name, address
FROM customers
WHERE country = "Spain";

The below SQL statement returns the data on the view.

SELECT * FROM [Spain Customers];

Related Links