What is View and how can write view ,update view and delete view??
Microsoft Net Framework

                             Views

 

What is View?

 

A view is nothing more than a SQL statement that is stored in the database with an associated name. A view is actually a composition of a table in the form of a predefined SQL query.

A view can contain all rows of a table or select rows from a table. A view can be created from one or many tables which depends on the written SQL query to create a view.

 

Advantages of view

 

1. View can be reduced complexity of data base schema

 

2. View can be used to implement Row &Column security

 

3. View can be used to present aggregated data and hide details data

 

4.  View the data without storing the data into the object.

 

How to Create a View Without using Join?

 

Create View [View Name]

AS

Select [Column 1],[Column 2],[Column 3]

From [Table Name]

How to Create a View using Join?

 

Create View [View Name]

AS

Select [Column 1],[Column 2],[Column 3]

From [Table Name]

 

Join [Table Name] on [Join Table.Table ID] = [First Table Table.Table ID]

 

 

1.How Update View?

 

Update View [View Name]

Set [Column Name] = [Name]

Where [Table ID] = [ Id Number]

 

2.How Delete Row?

Delete From [Table Name ]

Where [Table Id] = [ID]

 

3.How Insert Row in View?

Insert into [Table Name ]

([Column 1],[Column 2],[Column 3] )

Values

(‘Inserted Value 1’,’Inserted Value 2’,’Inserted Value 3’)

 

 

 

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM