Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

CREATE VIEW

CREATE VIEW

The CREATE VIEW command establishes a view, which is a virtual table derived from the output of an SQL statement.

The provided SQL generates a view that retrieves all customers from Brazil.

Example

CREATE VIEW [Brazil Customers] AS
SELECT CustomerName, ContactName
FROM Customers
WHERE Country = “Brazil”

Query The View

We can retrieve data from the aforementioned view using the following query.

Example

SELECT * FROM [Brazil Customers];