14-07-2012, 01:22 PM
MCS043
MCS043[3].ppt (Size: 645.5 KB / Downloads: 32)
Chapter Objectives
Specification of more general constraints via assertions
SQL facilities for defining views (virtual tables)
Various techniques for accessing and manipulating a database via programs in general-purpose languages
E.g., Java, C++, etc.
Constraints as Assertions
General constraints: constraints that do not fit in the basic SQL categories (presented in chapter 8)
Mechanism: CREAT ASSERTION
Components include:
a constraint name,
followed by CHECK,
followed by a condition
Using General Assertions
Specify a query that violates the condition; include inside a NOT EXISTS clause
Query result must be empty
if the query result is not empty, the assertion has been violated
Specification of Views
SQL command: CREATE VIEW
a table (view) name
a possible list of attribute names (for example, when arithmetic operations are specified or when we want the names to be different from the attributes in the base relations)
a query to specify the table contents