SQL Getting Started Tutorial: SQL CREATE VIEW
There is an opinion that is a view.
SQL declaration for creation period
In SQL, there is an opinion that is a virtual basis for the statement of the result set on the table.
There is a view that contains rows and columns, just like a real table. The field of view, field, from one or more real tables in the database.
You can add SQL functions, where, and add declarations to the current data, if the data is coming from a single table.
The SQL CREATE view syntax
CREATE VIEW View_name as
SELECT column_name (s)
From table_name
WHERE condition
Let's look at an example of a CREATE view.
If you have a Northwind database you can see that it has a few ideas for default installation. Think "Current Product List" lists all active products (product does not stop) from the "Products" table. The view is to create the following sql:create view [current Product List] as
SELECT Productid,productname
From Products
Where Discontinued=no we can query the above view as follows: SELECT * FROM [current product List] Another view is that the "product" for each product is selected in the Northwind sample database The unit price of the table is higher than the average unit price: CREATE VIEW [Products Above Average Price] As
SELECT Productname,unitprice
From Products
WHERE unitprice> (SELECT AVG (UnitPrice) from products) is queried as. SELECT * FROM [Products Above Average Price]sql Dropping a view you can delete in order to view commands with the drop view. In view of the falling SQL syntax drop view view_name