Question 135Asked in DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
What is the difference between a primary key and a foreign key in a database?
AA primary key is used to sort records in a table, while a foreign key is used to filter records in a table.
BA primary key is a unique identifier for each record in a table, while a foreign key is used to link records in one table to records in another table.
CThere is no difference between a primary key and a foreign key.
DA primary key is used to link records in one table to records in another table, while a foreign key is a unique identifier for each record in a table.
Show answerHide answer
Correct answer: (B) A primary key is a unique identifier for each record in a table, while a foreign key is used to link records in one table to records in another table.
Explanation
A primary key uniquely identifies each row in its table. A foreign key refers to a primary key in another table, which links the tables.
From DSSSB TGT Computer Science PYQ, 25 Jun 2023, Shift 3 (4:30 PM)