
Control questions
Please, give answers to the following questions:
What is the purpose of integrity constraints?
What type of integrity constraints do you know?
What syntactical forms of integrity constraints do you know? What are differences of these forms?
What does UNIQUE constraint means? What does composite unique key means? What syntax must be used (column constraint syntax, table constraint syntax) to describe composite unique key? Do NULL values allow in the columns with UNIQUE constraint? Is it possible to set UNIQUE and PRIMARY KEY constraints to the same column (combination of columns)?
What does PRIMARY KEY constraint mean? What is composite primary key? What syntax must be used (column constraint syntax, table constraint syntax) to describe composite primary key? How many primary keys may be defined in a table? Is it possible to set NULL value for the primary key column?
What does NULL (NOT NULL) constraint mean? What is a default value of this constraint? Is it possible to define this constraint with table constraint syntax?
What does FOREIGN KEY (referential integrity constraint) mean? Please, define the following terms: referenced key, foreign key, parent table, child table. What integrity constraint must have referenced column (combination of columns)? Is it possible to define foreign key and referenced key in the same table? What is composite foreign key? What syntax must be used (column constraint syntax, table constraint syntax) to describe composite foreign key? Is it possible to describe single column foreign key with table constraint syntax? Is it possible to use the same column (combination of columns) as foreign key and primary key? Is it possible to use the same column (combination of columns) as foreign key and unique key? Is it possible to define many foreign keys in a table? Is it possible to set NULL values of foreign key (composite foreign key)? Can you define a referential integrity constraint in a CREATE TABLE statement that contains an AS subquery clause? Is it possible to omit column names of parent table in foreign key clause? What does ON DELETE clause mean? What does absence of ON DELETE clause mean?
What does CHECK integrity constraint mean? When the CHECK condition is satisfied? Is it possible to define check constraint on multiple columns in column constraint syntax? Is it possible to define many CHECK constraints for the one column? Does Oracle verify that many CHECK conditions are mutually excusive? Is it possible to define CHECK conditions on the columns from different tables?
Appendices
Appendix. Conditionsin sql Oracle
A condition specifies a combination of one or more expressions and logical operators that evaluates to either TRUE, FALSE, or unknown. You must use this syntax whenever condition appears in SQL statements.
You can use a condition in the WHERE clause of these statements:
DELETE
SELECT
UPDATE
You can use a condition in any of these clauses of the SELECT statement:
WHERE
START WITH
CONNECT BY
HAVING
You can use a condition in CHECK clause of CREATE TABLE statement.
A condition could be said to be of the "logical" datatype, although Oracle does not formally support such a datatype.
Conditions can have several forms, as shown in the following syntax. The complete description of each statement will be discussed in the following labs. The sections that follow describe in general the various forms of conditions.
condition::=