View is a virtual table. It can have data from one or more tables.
It contains Rows and columns, just like Real Table.View can either have all rows of a table or specific rows based on condition.
Creating a View
Syntax :To create view
CREATE VIEW VIEW_NAME
AS
SELECT Column1,Column2,… FROM Table_Name
WHERE condition
Example :
Consider following Table “Employee”
You can create View named as “EMP_V1” whose EmpId are 1,2 by using below query.
Query:
CREATE VIEW EMP_V1
AS
SELECT * FROM Employee where id in(1,2)
You can check created view by using below syntax.
SELECT * from EMP_V1
Output :
Updating a View
UPDATE Command for View , Just like Update command for table.
Syntax:
UPDATE View_Name Set Value Where Condition
Example :
You can update Value of Field name whose id=1 in above created View EMP_V1.
Query :
UPDATE EMP_V1 SET NAME='JIJIN' Where ID=1
Output:
Dropping a View
Dropping command is used to delete view.
Syntax:
DROP VIEW View_Name
Example :
The following syntax drops “EMP_V1” view
DROP VIEW EMP_V1
Listing Views
Once Views is created in a database , You can check list of all views in a database by using following statement.
Select * from sys.views
Output :
Types of Views:
There are two types of views:
1) Simple View : It can have data from one table.
2) Complex View : It can have data from one or more table.
If you want to sell your readymade software to the genuine clients or businessman, list your software with details and demo links.
Clients will find it using our advanced search filter and will contact you directly.
No any charge for the product lsiting.