Which statements are true regarding primary and foreign key constraints and the effect they can have on table data?
Correct Answer: A,C,E
Regarding primary and foreign key constraints:
* A. A table can have only one primary key but multiple foreign keys. This is true. A table is constrained to have only one primary key, which can consist of multiple columns, but can have several foreign keys referencing primary keys in other tables.
* C. Primary key and foreign key constraints can be defined at both the column and table level.
True. Constraints can be defined inline with the column definition or separately at the end of the table definition.
* E. It is possible for child rows that have a foreign key to be deleted automatically from the child table at the time the parent row is deleted. This is also true if the foreign key is defined with the ON DELETE CASCADE option.
Options B, D, F, and G are incorrect:
* B is incorrect because if a parent row is deleted, the child rows cannot remain without violating the integrity unless the foreign key is defined with ON DELETE SET NULL or similar behavior.
* D is incorrect because both primary and foreign key constraints can be defined at both levels.
* F is incorrect as the names of the foreign key columns do not need to match the primary key column names.
* G is incorrect as a table can have multiple foreign keys.