VIEWS – BASIC info.

1. A view is a database object.

2. We can create a view with the help of create view command.Eg. Create view view_name as select statement.

3. The contents of the view are taken from one or more multiple tables.

4. Any modifications in the table will make affect in the view.

5. We can also update tables with the help of views.

6. You can query a view same as we query a table.

7. Views will give you the facility of data abstraction.

8. If one table is used in a view then it is called a simple view.

9. If more than one table is involved then it is called a complex view.

10.A view is a logical representation of a table or combination of tables.

11.Views are a virtual table like a normal table, a view consists of a set of named columns and rows of data.

12.If you create an index on a view . The database will store the view.

13.View with schema binding can only create an index.

14.For creating a non clustered index on the view we first have to create a clustered index on that.

15.Indexed views are called materialized views.

16.Views provides abstraction of data , restrict the access and provides better security.

17.It hides the complexity of data.

18.View depends on the structure of the table at the time of creation.

19.Eg. of view with schemabinding.

Create View CustView
With schemabinding
As
SELECT c.customerId , c.companyname , o.orderid,o.order_date
From dbo.customers c , dbo.Order o
on c.customerid = o.customerid

Will write one more article with examples to make views more clear.

Pawan Kumar
Pawankkmr@hotmail.com

Advertisements