Q 7. What is the view in SQL?
Views in SQL are a kind of virtual table. A view also has rows and columns as they are on a real table in the database.
We can create a view by selecting fields from one or more tables present in the database. A View can either have all the rows of a table or specific rows based on certain conditions.
The CREATE VIEW statement of SQL is used for creating views.
Basic Syntax:
CREATE VIEW view_name AS SELECT column1, column2..... FROM table_name WHERE condition; |
view_name : Name for the Viewtable_name: Name of the tablecondition :
Condition to select rows
No comments:
Post a Comment