Pages

Tuesday 19 February 2013

Concept of View in SQL Server


Concept of View in SQL Server

  1. A view is defined by a query and only shows the data which is defined at the time of creation of the view.
  2.  A view is virtual, the data from a view is not stored physically. 
  3. It is a set of queries that, when applied to one or more tables, is stored in the database as an object.
  4. Views are used for security purpose in the database because it hides the name of the table and logic and provides the virtual table.
  5. A view is used to store the SELECT statement only. In the view we can modify the data and table. 

Syntax of a View

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

Example

create view stud
as  select studname,studid,studaddress
from student where depno='d001'

No comments:

Post a Comment