One Unique Row Identifier
AQA 3.7.1 requires a primary key: the field that uniquely identifies each record. No two rows share it, and it is not left blank.
Example: StudentID 1042 points to one pupil even if two pupils are called Sam Lee. Names or dates of birth make poor keys because they can repeat or change. Other tables will use this key to point back to the row.
A primary key must be
{"answers": {"A": "Unique for every record", "B": "The longest text field", "C": "Stored in ROM", "D": "The same in every table"}, "question_text": "A primary key must be", "correct_answer": "A"}
Primary Key versus Ordinary Field
Primary key
OrderID = 881 identifies one order. The database can index it and refuse a duplicate insert, which keeps every order addressable.Ordinary field
Town = "Leeds" can appear on hundreds of rows. It describes the record; it does not identify it, so it must not be used as the key.
A [[primary]] key uniquely identifies each [[record]] in a table.
{"cloze_text": "A [[primary]] key uniquely identifies each [[record]] in a table."}
{"keyword": "primary key", "definition": "A field that uniquely identifies each record in a table and is not left empty"}
Question Type: fill in the blanks
{"paragraph": "Two rows must not share the same primary [[key]], and it should not be [[blank]]."}
{"paragraph": "Two rows must not share the same primary [[key]], and it should not be [[blank]]."}
Question Type: short answer
{"answer": "Names can be duplicated or changed, so they do not uniquely identify a record.", "rubric": {"0": "Incorrect or no response", "1": "Partial credit", "2": "Names can be duplicated or changed, so they do not uniquely identify a record."}, "question": "Why is a person's name a poor primary key?"}
{"answer": "Names can be duplicated or changed, so they do not uniquely identify a record.", "rubric": {"0": "Incorrect or no response", "1": "Partial credit", "2": "Names can be duplicated or changed, so they do not uniquely identify a record."}, "question": "Why is a person's name a poor primary key?"}
Complete! Ready to test your knowledge?
Primary keys
- One Unique Row Identifier
- Primary Key versus Ordinary Field