You are on page 1of 1

A view is an "Virtual Table".

It is not like a simple table, this is an virtual table which contains columns and data from different table ( may be one or more tables) . View does not contain any data directly, it is a set of query that are applied to one or more tables that is stored within the database as object. Aft er creating a view from some Table, it just used as a reference of those table a nd when executed shows only those data which are already mention in query during the creation of View image1

Use of VIEW Views are used as Security Mechanism of Database. Because it restricts user to v iew certain column and Rows. Views display only those data which are mentioned i n the query, so its shows only those data which returns by the query that is def ined at the time of creation of view. So rest data are totally abstract from the end user. Along with Security the other advantages of view is Data abstraction. Because en d user is not aware of all the data in Table.

syntax: CREATE VIEW [View Name] AS [SELECT Statement]. eg: CREATE VIEW SampleView As SELECT EmpID, EmpName FROM EmpInfo Get Result From View: select * from SampleView Drop a View DROP VIEW SampleView select dealername from dealers d where country in(select country from customers c where c.country=d.country)

You might also like