A foreign key is used to establish relationships between tables in a database, linking a field in one table to a unique identifier in another. It promotes data integrity and prevents inconsistencies in the database. Thus, the correct answer to the question is B. To establish a relationship between tables.
;
A foreign key is used to establish relationships between tables in a database, ensuring data integrity and referential integrity. It links a field in one table to a unique identifier in another, preventing inconsistencies. While it doesn't uniquely identify records (like a primary key), it plays a key role in relational database design. ;