engineering computer science MCQ #771

What is the difference between a primary key and a foreign key?

engineering computer science MCQ #771

  1. Question 1

    Q1. What is the difference between a primary key and a foreign key?

    • A) Primary key is used for indexing, foreign key is used for data integrity
    • B) Primary key is used for data integrity, foreign key is used for indexing
    • C) Primary key uniquely identifies a record, foreign key references a primary key
    • D) Primary key references a foreign key, foreign key uniquely identifies a record

    Answer: Primary key uniquely identifies a record, foreign key references a primary key

    Explanation: A primary key is a unique identifier for a record, while a foreign key is a field that references the primary key of another table.