Correct option is B
In SQL, a
view is a
virtual table that is derived from one or more existing tables through a
SELECT query. It does
not store data physically but provides a
dynamic representation of the data based on the underlying tables.
Important Key Points:
1.
Definition of SQL Views:
· A
view is a stored SQL query that can be used as a table.
· It does not contain actual data but
retrieves data dynamically from the base tables.
· Example of creating a view:
CREATE VIEW EmployeeView AS
SELECT EmpID, Name, Salary
FROM Employees
WHERE Salary > 50000;
2.
Why Views are Called Virtual Tables?
·
Views behave like tables when queried, but they
do not store data physically.
· They help in
data abstraction, security, and simplifying complex queries.
· Users can perform operations like SELECT, JOIN, and FILTER on views as they do with tables.
3.
Views can be updated in SQL if they are
simple views (based on a single table without aggregations).
4.
Materialized Views
(different from standard views) store data physically and improve performance for large datasets.
5.
Views enhance security by restricting direct access to underlying tables while providing necessary data access.
6.
Indexing in views can improve performance when querying frequently accessed data.
Knowledge Booster:
·
Simple tables → ❌ Incorrect, because views do not physically store data like real tables.
·
(c) Complex tables → ❌ Incorrect, because views are not necessarily complex; they simply provide a dynamic representation of data.