0% found this document useful (0 votes)
5 views4 pages

What Is AView

A VIEW in SQL Server is a virtual table that presents data from one or more tables without storing it physically in the database. It is defined using a SQL query and requires a unique name within the database. To create a view, the 'CREATE VIEW' statement is used followed by a SELECT query to specify the data to be included.

Uploaded by

Vignesh Shenoy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

What Is AView

A VIEW in SQL Server is a virtual table that presents data from one or more tables without storing it physically in the database. It is defined using a SQL query and requires a unique name within the database. To create a view, the 'CREATE VIEW' statement is used followed by a SELECT query to specify the data to be included.

Uploaded by

Vignesh Shenoy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

What is a View ?

What is a View ?
• A VIEW in SQL Server is like a virtual table that contains data from one or multiple tables.

• It does not hold any data and does not exist physically in the database.

• Similar to a SQL table, the view name should be unique in a database.

• It contains a set of predefined SQL queries to fetch data from the database..

• It can contain database tables from single or multiple databases as well.

• A VIEW does not require any storage in a database because it does not exist physically.
View definition contd..
How to create a View
• CREATE VIEW Name AS

Select column1, Column2...Column N From tables

Where conditions;

• CREATE VIEW EmployeeRecords

AS

SELECT Person.Person.Title, Person.Person.FirstName, Person.Person.LastName,

Person.PersonPhone.PhoneNumber, Person.PhoneNumberType.Name

FROM Person.Person INNER JOIN

Person.PersonPhone ON Person.Person.BusinessEntityID = Person.PersonPhone.BusinessEntityID INNER JOIN

Person.PhoneNumberType ON Person.PersonPhone.PhoneNumberTypeID = Person.PhoneNumberType.PhoneNumber


TypeID

WHERE (Person.Person.Title = N'Mr.')

You might also like