Primary Key vs Candidate Key
Primary Key vs Candidate Key sits in a big table. Riya’s job is lookup by roll. Write that first.
Keep Primary Key vs Candidate Key small. Riya should finish lookup by roll in a few lines, not a 40-line dump.
Skip Primary Key vs Candidate Key and indexing a low-cardinality flag only shows up in a big table.
Use Primary Key vs Candidate Key when lookup by roll must stay clear. If a simpler SQL step works, use that instead.
If lookup by roll breaks under Primary Key vs Candidate Key, check indexing a low-cardinality flag only first.
After Primary Key vs Candidate Key, Riya should still remember indexing a low-cardinality flag only.
One breath for Primary Key vs Candidate Key, then lookup by roll, then indexing a low-cardinality flag only. Sit down.
students.id ← PK (unique)
▲
│ FK
marks.student_idFor Primary Key vs Candidate Key: definition + a big table + one failure.