Database views are created from one or more base tables or from other views. Views are virtual tables that you can use to retrieve data from the underlying views or tables. A view does not contain data and therefore does not use any space. Only the view definitions are stored in the Data Dictionary.
A view may present only a subset of the columns and rows in the base table or tables. Also, a column defined in a view can be derived and need not exist in the underlying base tables. For example, you can display summed or averaged data in a view column.
Views are used to do the following:
- Allow users to access only the needed table rows and columns.
- Enforce security by restricting table access and updates.
- Provide well-defined, well-tested, high-performance access paths to data.
- Provide logical data independence, which minimizes the need to modify your applications if you restructure base tables.
- Format the output of the data for reports.
- Specify locking, such as specifying a less restrictive ACCESS lock.
For data integrity and system security, Teradata recommends the following:
- Set privileges so that general users cannot access or modify data tables directly.
- Create views that allow general users to access or modify only needed table data. Use views to restrict users to performing specific queries and update functions.
- Create views in a Views Database.
You can use the following utilities to create views in Teradata:
- BTEQ
- Teradata Studio
BTEQ and Teradata Studio allow you to submit CREATE VIEW DDL statements to Analytics Database.