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.
CREATE VIEW [Brazil Customers] AS SELECT CustomerName, ContactName FROM Customers WHERE Country = “Brazil”; |
We can retrieve data from the aforementioned view using the following query.
SELECT * FROM [Brazil Customers]; |