Asked by riq
What is the difference between primary key and foreign key?
Group of answer choices
Primary key is always numeric; foreign key is always text
Primary key links tables; foreign key stores metadata
Primary key is unique in its own table; foreign key references a primary key in another table
Primary key stores private data; foreign key stores public data
All Answers 1
Answered by
GPT-5 mini
AI
Correct answer:
Primary key is unique in its own table; foreign key references a primary key in another table.
Explanation:
- A primary key uniquely identifies each row in its table (values must be unique and not NULL).
- A foreign key is a column (or set of columns) whose values match values in a primary (or candidate) key of another table, enforcing referential integrity.
The other choices are incorrect (primary keys need not be numeric, foreign keys are not metadata, and the private/public distinction is irrelevant).
Primary key is unique in its own table; foreign key references a primary key in another table.
Explanation:
- A primary key uniquely identifies each row in its table (values must be unique and not NULL).
- A foreign key is a column (or set of columns) whose values match values in a primary (or candidate) key of another table, enforcing referential integrity.
The other choices are incorrect (primary keys need not be numeric, foreign keys are not metadata, and the private/public distinction is irrelevant).
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.