Question - What do you understand by the view and mention the steps to create, update and drop a view?
Answer -
A view in SQL is a single table, which is derived from other tables. So, a view contains rows and columns similar to a real table and has fields from one or more table.
To create a view, use the following syntax:
- CREATE VIEW ViewName AS
- SELECT Column1, Column2, ..., ColumnN
- FROM TableName
- WHERE Condition;
To update a view, use the following syntax:
- CREATE VIEW OR REPLACE ViewName AS
- SELECT Column1, Column2, ..., ColumnN
- FROM TableName
- WHERE Condition;
To drop a view, use the following syntax: