Views can be considered as virtual tables. Generally speaking, a table has a set of definition, and it physically stores the data. A view also has a set of definitions, which is build on top of table(s) or other view(s), and it does not physically store the data.
The syntax for creating a view is as follows:
"SQL Statement" can be any of the SQL statements we have discussed in this tutorial.
Let's use a simple example to illustrate. Say we have the following table:
|Column Name||Data Type|
and we want to create a view called V_Customer that contains only the First_Name, Last_Name, and Country columns from this table, we would type in,
AS SELECT First_Name, Last_Name, Country
Now we have a view called V_Customer with the following structure:
'etc > Database(SQL)' 카테고리의 다른 글
|Create View Syntax Example (0)||2019.03.06|
|Int vs GUIDs Primary Key in database (0)||2019.02.13|
|How to write INSERT IF NOT EXISTS queries in standard SQL (0)||2018.07.31|
|MariaDb, MySql datetime query. (0)||2018.05.31|
|CLUSTERED 와 NONCLUSTERED index 인덱스 관리 기본 정리 (0)||2018.05.11|
|SQL Server Date Format (0)||2018.04.29|