View
- is a virtual table defined by a SELECT query
- there are 2 types of views:
- Non-Indexed/Non-Materialized View
- Indexed/Materialized View
Non-Indexed/Non-Materialized View
Creating a non-indexed view
CREATE VIEW ViewNameHere
AS {REPLACE WITH SELECT QUERY HERE}
Indexed/Materialized View
Creating a indexed view
CREATE VIEW ViewNameHere
WITH SCHEMABINDING
AS {REPLACE WITH SELECT QUERY HERE}
Querying Views
select v.col1, t.col2
from VIEW v, TABLE t
where v.col1 = t.col1