Question bank / Freshers (India), Role Knowledge, Foundation

How to answer: What is the difference between a primary key and a foreign key?

Whether you understand how tables relate.

What the interviewer is testing.

Definitions plus a two table example. Whether you understand how tables relate.

An outline for this question.

  1. A primary key uniquely identifies each row in a table and cannot be empty.
  2. A foreign key is a column that points to the primary key of another table, linking them.
  3. Give an example: a Students table with student_id as the primary key, and an Enrollments table that holds student_id as a foreign key.
  4. Mention that the foreign key keeps the data consistent.

The mistake to avoid.

Defining them without an example. Two tables make it clear.

The general method: frame, evidence, recommendation.

The same shape works for most role knowledge questions, whatever the topic.

  • Frame the problem: what is being decided and who is affected.
  • Say what evidence you would gather first, and why that order.
  • Give a clear recommendation and the risk you would watch.

Practice it, out loud.

Reading an outline is not the same as saying it. Answer this question in a mock interview, in your own words, then compare it with the outline above.

Practice this questionSee live interview help

This is a Replysis practice question. It is not a leaked or official question from any company, and the outline is a guide to structure, not a script. Use your own experience and facts.