Ch05
Ch05
5
More
SQL:
Complex
Queries,
Triggers,
Views, and
Schema
Modification
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Chapter 5 Outline
More Complex SQL Retrieval
Queries
Specifying Constraints as Assertions
and Actions as Triggers
Views (Virtual Tables) in SQL
Schema Change Statements in SQL
Comparison operator IN
Compares value v with a set (or
multiset) of values V
Evaluates to TRUE if v is one of the
elements in
V
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Nested Queries (cont’d.)
Example:
ALTER TABLE COMPANY.EMPLOYEE ADD
COLUMN Job VARCHAR(12);
To drop a column
Choose either CASCADE or RESTRICT
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
The ALTER Command
(cont’d.)
Change constraints specified on a
table
Add or drop a named constraint