SQL Reference Contents

NAME

create view - construct a virtual class

SYNOPSIS

create view view_name as
select expression1 [as attr_name1]
{, expression_i [as attr_namei]}
[from from.last]
[where qual]

DESCRIPTION

create view will define a view of a class. This view is not physically materialized; instead the rule system is used to support view processing as in [STON90]. Specifically, a query rewrite retrieve rule is automatically generated to support retrieve operations on views. Then, the user can add as many update rules as desired to specify the processing of update operations to views. See [STON90] for a detailed discussion of this point.

EXAMPLE

--
--create a view consisting of toy department employees
--
create view toyemp as
select e.name
from emp e
where e.dept = 'toy'
--
--Specify deletion semantics for toyemp
--
create rule example1 as
on delete to toyemp
do instead delete emp
where emp.oid = current.oid

SEE ALSO

create table(l) , create rule(l) ,


Table of Contents