Correct option is A
An attribute of one table that matches the primary key of another table is called a foreign key. The foreign key is used to establish and enforce a link between the data in two tables. It ensures referential integrity by maintaining a relationship between the two tables. The foreign key in the child table references the primary key in the parent table, allowing for the accurate association of data.
Important Key Points:
1. Foreign Key: A foreign key in one table points to the primary key in another table. This relationship allows for data consistency and prevents invalid data entries.
2. Establishing Relationships: It is used to link two tables together, helping in organizing data in a relational database by creating logical connections.
3. Referential Integrity: Foreign keys ensure that data in the tables remains consistent and that relationships between tables are valid.
4. Data Consistency: It helps maintain the consistency of data by ensuring that every value in the foreign key column corresponds to an existing value in the referenced table.
Knowledge Booster:
· Secondary Key: A secondary key is an attribute that can be used for searching data but is not a primary key or foreign key. It does not necessarily link two tables together.
· Candidate Key: A candidate key is any column or set of columns that could be a primary key for a table, but it is not specifically used to establish relationships between different tables.