In: Computer Science
1. MySQL can enforce referential integrity for a delete operation performed on a parent table record by ____________________ .
A. returning an error instead of deleting any rows.
B. setting the foreign key values in the related child table rows to null.
C. deleting the related rows in the corresponding child table(s).
D. applying any one of the above, (a, b or c), depending on how the foreign key constraint is defined.
2. Third normal form (3NF) eliminates which of the following issues in a table?
A. Transitive dependencies
B. Functional dependencies
C. Partial dependencies
D. Repeating, or multi-valued columns
3. For a table to be in the second normal form (2NF), each non-primary key column in the table must __________________
A. depend on only one column that is part of the composite primary key of the given table.
B. depend on all columns that make up the composite primary key of the given table.
C. have a unique value.
D. have a non-NULL value.
Answer:
Question 1: applying any one of the above, (a, b or c), depending on how the foreign key constraint is defined.
if ON DELETE SET NULL is definied on table then it sets the foreign key values in the related child table rows to null.
if ON DELETE CASCADE is definied on table then it deletes the related rows in the corresponding child table.
So d will be the answer.
Question 2: Transitive dependencies
Question 3: depend on all columns that make up the composite primary key of the given table.