Concept of View in SQL Server
- A view is defined by a query and only shows the data which is defined at the time of creation of the view.
- A view is virtual, the data from a view is not stored physically.
- It is a set of queries that, when applied to one or more tables, is stored in the database as an object.
- Views are used for security purpose in the database because it hides the name of the table and logic and provides the virtual table.
- 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