Under what circumstances can a foreign key column not match the defined primary key value in the parent table?
Answer: 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.
True or false: A CHECK constraint cannot check for NULL values.
Answer: 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.
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?
Answer: 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).
Write a CHECK constraint that ensures MAX_SALARY is at least 10,000 more than MIN_SALARY.
Answer: This constraint ensures MAX_SALARY is at least 10,000 more than MIN_SALARY: check (max_salary - 10000 > min_salary)
What statement will allow a partial rollback of certain DML statements within a transaction?
Answer: The ROLLBACK TO SAVEPOINT <savepoint>; statement will allow a partial rollback of certain DML statements.
True or false: A NOT NULL constraint can be defined at the table level or at the column level.
Answer: False, a NOT NULL constraint can be defined only at the column level.
What kind of constraint establishes a parent-child relationship between two tables via one or more common columns?
Answer: A foreign key constraint establishes a parent-child relationship between two tables via one or more common columns.
If the database crashes while a user session is active, what type of transaction processing is automatically performed when the database is restarted?
Answer: If the database crashes, an automatic ROLLBACK of any pending transactions is performed when the database is restarted.