SQL getting started Tutorial: SQL CREATE VIEW
One opinion is that it is a view.
SQL statement during creation
In SQL, there is a suggestion that a statement is a virtual result set statement based on the table.
There is an opinion that contains rows and columns, just like a real table. The viewpoint of this field, field, from one or more real tables in the database.
You can add SQL functions, where, and add declarations, In order to and present data if the data is from a single table.
SQL CREATE VIEW syntax
Create view view_name
SELECT column_name (s)
FROM table_name
WHERE condition
Let's take a look at an instance of create view.
If you have the Northwind database, you can see that it has several ideas for default installation. The "current product list" lists all active products (products do not stop) from the "Products" table. The idea is to establish the following SQL: CREATE VIEW [Current Product List]
SELECT ProductID, ProductName
FROM Products
WHERE Discontinued = No we can query the above points as follows: SELECT * FROM [Current Product List] Another view is that the unit price for selecting the "Product" table for each Product in the Northwind sample database is higher than the average unit price: create view [Products Above Average Price]
SELECT ProductName, UnitPrice
FROM Products
WHERE UnitPrice> (select avg (UnitPrice) FROM Products) query is. SELECT * FROM [Products Above Average Price] SQL Dropping a View you can delete, With a VIEW View command down. In VIEW of the dropped SQL syntax DROP VIEW view_name