2. What is a View A View is a query which is stored in a server in the form of an object. The Power of a view lies in the fact that it can be referenced as a table. It provides an abstraction of the underlying data. The Main use of using a view is the security that it offers. A Third-Person may be restricted to view only a portion of a database, while hiding the rest of sensitive data The Illustration is made in the next slide.
3. What is a View Remember that the view exists as query and not as a table
4.
5.
6. Views are used to provide additional security over data
7. It also prevents unwanted tampering of sensitive data
8.
9. Using Views After creating a view, it can used as if it is a table. It can queried like a normal table: Select * from nameList The above query on the view will return: Thus, a view provides a good level of abstraction over the database.
10. Modifying Views An existing view is modified like using the alter view statement. The Syntax Alter view <viewName> As …QUERY that results in a table/data… GO Similar to the alter procedure statement, the alter table command redefines the existing view defenition.
11. Deleting Views The Syntax: Drop view <viewName> Example: Drop view nameList