Views are logical tables on top of a physical table you can create. If there are no base tables, there is no concept of Views.
Rules to create a View
- It gives an error if the physical table is not present in the database.
- You cannot delete records in the view since it’s logical.
Types of Views
Purpose of Views
- Control access to table-data
- Make data easier-to-use
- Simplify authorization; you can give access to only a view instead of the table
- Show only portions of table-data
- Show summary of a table
- Combine two or more tables in meaningful ways
- Show only the selected rows that are pertinent to the process that uses the view
Examples to Create a View
Example – 1
CREATE VIEW ma_proj AS
WHERE substr(projno, 1, 2) = 'MA'
CREATE VIEW ma_proj AS selectprojno,