Q1
True / FalseA foreign key is used to uniquely identify each row in a table.
A foreign key is used to establish a link between the data in two tables, not to uniquely identify rows in a table.
Q2
True / FalseA foreign key constraint ensures the referential integrity of the data in one table to match values in another table.
The foreign key constraint ensures that the value in one table matches a value in another table, maintaining referential integrity.
Q3
True / FalseA foreign key in one table points to a primary key in another table.
A foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table. The foreign key references the primary key of the other table.
Q4
True / FalseForeign keys can be null.
Foreign keys can contain NULL values unless they have a NOT NULL constraint. This can happen when a foreign key does not always reference an existing primary key.
Q5
True / FalseA table can have multiple foreign keys.
A table can indeed have multiple foreign keys, each linking to a primary key in another table.
Q6
True / FalseThe foreign key constraint prevents actions that would destroy links between tables.
Foreign key constraints prevent actions that would lead to orphaned records in a related table, thus maintaining referential integrity.
Q7
True / FalseA foreign key must reference an existing primary key in the parent table.
A foreign key must reference an existing primary key value in the parent table to maintain referential integrity.
Q8
True / FalseDeleting a row in a parent table will always delete related rows in the child table if a foreign key is present.
Whether related rows in a child table are deleted when a parent row is deleted depends on the ON DELETE action specified in the foreign key constraint (e.g., CASCADE, SET NULL).
Q9
True / FalseForeign keys cannot reference columns that are not primary keys in the parent table.
Foreign keys typically reference primary key columns in the parent table, but they can also reference unique constraints in some databases.
Q10
True / FalseForeign keys are primarily used for maintaining data integrity.
Foreign keys are used to ensure that relationships between tables remain consistent, thus maintaining data integrity.
Q11
True / FalseThe SQL standard does not require support for foreign key constraints.
The SQL standard does require support for foreign key constraints to ensure referential integrity, although implementation can vary between databases.
Q12
True / FalseA foreign key constraint can be added to an existing table.
Foreign key constraints can be added to existing tables using the ALTER TABLE statement.
Q13
True / FalseA foreign key relationship can be created between two columns in the same table.
A foreign key can reference a column in the same table, which is often used in hierarchical or self-referencing relationships.
Q14
True / FalseForeign keys do not allow duplicate values in the child table.
Foreign keys can have duplicate values in the child table, as they are not required to be unique like primary keys.
Q15
True / FalseA foreign key can reference a non-primary key column in the parent table if that column has a unique constraint.
Foreign keys can reference columns with unique constraints in the parent table, not just primary key columns.