Introduction
View is a virtual table which use to display the data from one and more than one table .View use for security and restriction of acess the data. Suppose there is one software company X and the client of X company is Y. Y would like to know the all details of Employee of X. But Company X would not like to share salary details to Y. In this case company will be create one view excluding Salary column and they will show the details to their client Y.
Before discussing about view we will be discuss the task which has to perform in database.
- Creating table in database
- Creating View
- Creating table in database
Step 1: Go to start button and select SQL server management studio as showing in below figure.

Now click on SQL server management studio and go to object explorer.
Step 2: Create a new database by using.
Create database database_Name
In this Discussion I have created a database as name DVView as showing in below figure.

Now go to table and create two table:
- Employee
- Branch

Create table employee with 4 column as:
- create table Employee(eid int primary key,ename varchar(20),designation varchar(20),mgrid int)

Now insert the values in table Employee:
- insert into Employee values(1,'Sandeep','DBA',2)
- insert into Employee values(2,'Rakesh','.Net Developer',1)
- insert into Employee values(3,'sohan','Java Developer',1)
- insert into Employee values(4,'Suresh','Software Trainee',3)
- insert into Employee values(5,'Mohan','Software Trainee',4)
- select * from Employee





Santhakumar MunuswamyPosted Feb 13, 2016, 12:20 AM
Thanks for nice share
Anil Kumar MurmuPosted Feb 11, 2016, 4:33 AM
Thanks for sharing