bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL CREATE VIEW Keyword

Create View

The CREATE VIEW command creates a view.

A view is a virtual table based on the result set of an SQL statement.

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

Example

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

Query The View

We can query the view above as follows:

Example

SELECT * FROM [Brazil Customers];

Previous

SQL CREATE UNIQUE INDEX Keyword

Next

SQL DATABASE Keyword