What is a view in SQL? How to create one ,What are the uses of view?

5/8/2022
All Articles

view in dbms #views in dbms #what is view #sql create a view #create view sql #sql create view #sql command view

What is a view in SQL? How to create one ,What are the uses of view?

What is a view in SQL? How to create one ,What are the uses of view?

A view is a virtual table based on the result-set of an SQL statement. We can create
using create view syntax.


CREATE VIEW developer_view AS
SELECT column_name(s)
FROM developer
WHERE condition

Below is properties of SQL view 

 

  1. Views can represent a subset of the data contained in a table; consequently, a view can  limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.
  2. Views can join and simplify multiple tables into a single virtual table
  3. Views can act as aggregated tables, where the database engine aggregates data (sum, average etc.) and presents the calculated results as part of the data
  4. Views can hide the complexity of data; for example a view could appear as Sales2000 or Sales2001, transparently partitioning the actual underlying table.
  5.  Depending on the SQL engine used, views can provide extra security

Article