Question
What is the purpose of using foreign keys in a
relational database?Solution
Foreign keys are a fundamental concept in relational databases, serving to establish a relationship between two tables. A foreign key in one table points to a primary key in another table, thus creating a link between the two. This relationship helps maintain referential integrity, ensuring that relationships between records are consistent. For example, if a "Customer" table has a foreign key that points to a "Country" table, it guarantees that every customer is associated with a valid country record. Option A (To uniquely identify a record in a table) describes the purpose of primary keys, not foreign keys. Option C (To create indexes for faster data retrieval) is misleading; while foreign keys can be indexed, their primary role is to enforce relationships. Option D (To store temporary data during transactions) is incorrect, as foreign keys do not store data; they link data between tables. Option E (To define data types for columns in a table) is unrelated to foreign keys; data types are defined separately in the table schema.
Which state government will be providing 300 units of electricity to the public from 1st July, 2022?
Who built the Sun Temple in Odisha during the 12th Century AD?
Great Bear' is the name of a:
मकराना में मिलने वाला प्रसिद्ध संगमरमर की किस्म क्या है ?
Galathea Bay National Park is situated in which of the following?
Who emphasized that "foreign medium has turned our children into crammers and imitators and has made our children practically foreigners in their own la...
When were the first Paralympic Games held?
In May 2019, the International Monetary Fund agreed to bail out ______with a fund of $6 billion.
Birju Maharaj is related to which of the following fields?
Holcim company is based in which country?