Creating Views - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Working with views
Similarities between
views and base tables
Differences between
views and permanent
tables
Benefits of tailoring
access

Creating views

Example
128
Views are similar to the permanent tables of the database (a permanent table is
also called a base table) in many ways:
You can assign access permissions to views just as to base tables.
You can perform
SELECT
You can perform
INSERT
You can create views based on other views.
There are some differences between views and permanent tables:
You cannot create indexes on views.
You cannot perform
views.
You cannot assign integrity constraints and keys to views.
Views refer to the information in base tables, but do not hold copies of that
information. Views are recomputed each time you invoke them.
Views are used to tailor access to data in the database. Tailoring access serves
several purposes:
Improved security
relevant.
Improved usability
with data in a more easily understood form than in the base tables.
Improved consistency
of common queries.
A
statement operates on one or more tables and produces a result set
SELECT
that is also a table: just like a base table, a result set from a
columns and rows. A view gives a name to a particular query, and holds the
definition in the database system tables.
Suppose that you frequently need to list the number of employees in each
department. You can get this list with the following statement:
SELECT dept_ID, count(*)
FROM employee
GROUP BY dept_ID
You can create a view containing the results of this statement as follows:
queries on views.
and
operations on some views.
DELETE
,
, and
INSERT
DELETE
UPDATE
By not allowing access to information that is not
By presenting users and application developers
By centralizing in the database the definition
operations on all
query has
SELECT

Advertisement

Table of Contents
loading

Table of Contents