Are you new to the wonderful world of databases? Confused by thesudden flood of technical jargon? Don't know the difference between a"trigger" and a "stored procedure", a "join" and a "subquery"? Look nofurther - the solution is right here!
Closely related to joins and subqueries is the concept of "views", which offers yet another way of displaying specific data slices.
Unlike joins and subqueries, which are based on actual database tables, a view is a table derived from the content present in other tables. Think of a view as a virtual table, one which contains values from other tables (these values selected on the basis of user-defined rules), and which can be manipulated in exactly the same way as a regular table.
Since a view is based on the data present in "real" tables, the data you see in the view changes as the data in the base tables changes. A view also provides a simple way to restrict access to sensitive fields in a database table, allowing you to exclude certain fields from display, and can be used in combination with joins to discover new relationships between different data items.
For example, the following command creates a view named "highRollers", which only contains a list of accounts with a balance in excess of $1000.00
sql> CREATE VIEW highRollers AS SELECT CustomerID FROM balance WHERE
AccountBalance >=1000.00;
And now, when you display the contents of the "highRollers" view, this
is what you'll see:
Any changes made to the "customers" table will be immediately
reflected in the view; similarly, changes made to the data in the view will be executed on the underlying table.