Correct option is B
A foreign key is a field (or a set of fields) in one table that is used to establish and enforce a link with the primary key in another table. Statement I is correct because it ensures referential integrity between two tables. Statement III is also correct because foreign keys are specifically used to create relationships between tables. However, statements II and IV are incorrect because a foreign key does not uniquely identify records (this is the role of a primary key), and it can contain duplicate values.
Important Key Points:
1. Referential Integrity: A foreign key ensures the value in one table corresponds to an existing value in the primary key of another table, maintaining data consistency.
2. Relationships: Foreign keys are critical for defining relationships in relational databases, supporting one-to-many or many-to-many associations.
3. Non-Uniqueness: Unlike a primary key, a foreign key can hold duplicate values, as it represents a reference rather than a unique identifier.
Knowledge Booster:
· Primary Key: Uniquely identifies each record in a table and does not allow null values.
· Unique Key: Similar to a primary key but can allow one null value, ensuring uniqueness within the column.
· Composite Key: A combination of two or more columns in a table to uniquely identify a record.
· Candidate Key: Any column or combination of columns that can qualify as a primary key.