Chapter 7


1.

A COMMIT occurs under which three conditions within a transaction?

a commit occurs from an explicit commit command, after a ddl or dcl command is executed, or when a sql*plus or isql*plus session is exited normally.

2.

Under what circumstances can a foreign key column not match the defined primary key value in the parent table?

a foreign key column may not match the defined primary key value in the parent table when the foreign key column allows null values and is null .

3.

True or false: A CHECK constraint cannot check for NULL values.

false, a check constraint can use is null and is not null to check for the existence of null values in one or more columns of the table.

4.

How are PRIMARY KEY constraints and UNIQUE constraints different? List two ways.

 primary key constraints do not allow null values, and there can be only one primary key per table.

5.

What are the three conditions that may be specified, either implicitly or explicitly, on a foreign key column when the primary key column in the parent table is deleted?

by default, the row in the parent table will not be deleted if rows exist in the child table that have a foreign key referencing the parent table s primary or unique key. alternatively, the child table s foreign key may be set to null ( set null ), or the entire row in the child table may be deleted if a parent row is deleted ( cascade ).

6.

Write a CHECK constraint that ensures MAX_SALARY is at least 10,000 more than MIN_SALARY.

this constraint ensures max_salary is at least 10,000 more than min_salary :

7.

What statement will allow a partial rollback of certain DML statements within a transaction?

the rollback to savepoint - savepoint - ; statement will allow a partial rollback of certain dml statements.

8.

True or false: A NOT NULL constraint can be defined at the table level or at the column level.

false, a not null constraint can be defined only at the column level.

Answers

1.

A COMMIT occurs from an explicit COMMIT command, after a DDL or DCL command is executed, or when a SQL*Plus or iSQL*Plus session is exited normally.

2.

A foreign key column may not match the defined primary key value in the parent table when the foreign key column allows NULL values and is NULL.

3.

False, a CHECK constraint can use IS NULL and IS NOT NULL to check for the existence of NULL values in one or more columns of the table.

4.

PRIMARY KEY constraints do not allow NULL values, and there can be only one primary key per table.

5.

By default, the row in the parent table will not be deleted if rows exist in the child table that have a foreign key referencing the parent table’s primary or unique key. Alternatively, the child table’s foreign key may be set to NULL (SET NULL), or the entire row in the child table may be deleted if a parent row is deleted (CASCADE).

6.

This constraint ensures MAX_SALARY is at least 10,000 more than MIN_SALARY:

7.

The ROLLBACK TO SAVEPOINT <savepoint>; statement will allow a partial rollback of certain DML statements.

8.

False, a NOT NULL constraint can be defined only at the column level.

check (max_salary - 10000 > min_salary)




Oracle9i DBA JumpStart
Oracle9i DBA JumpStart
ISBN: 0782141897
EAN: 2147483647
Year: 2006
Pages: 138
Authors: Bob Bryla

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net