You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/30-schema-design/020-primary-key.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,17 +65,19 @@ The three questions of entity integrity must be answered not just in theory, but
65
65
66
66
**Question 1: How do I prevent duplicate records?**
67
67
- Each student gets a unique student ID number when they enroll
68
-
- The database enforces that no two students can have the same student ID
68
+
- To ensure that the student has not previously registered, additional verification is performed to search the existing records. The student may be asked to provide other names that they have used in the past.
69
+
- Additional uniqueness constraints may be imposed on other attributes such as drivers license number, passport number, email, social security number, cellphone, etc.
69
70
- Before inserting a new student record, the system checks if that student ID already exists
70
71
71
72
**Question 2: How do I prevent entities sharing the same record?**
72
-
- Each student ID can only be assigned to one person
73
-
- If a student graduates and the ID is reused years later, the old record must be properly archived
73
+
- Each student ID can only be assigned to one person.
74
+
- At registration, the university will issue a photo ID card to the student that allows verifying that another student is not pretending to be the student in the records.
75
+
- If a student graduates and the ID is reused years later, the old record must be properly archived, although in most systems, such IDs are retired and not reused.
74
76
75
77
**Question 3: How do I match entities?**
76
-
- When a student comes to the registrar's office, they can look up their record by student ID
77
-
- The database can quickly find the student's record using the student ID as the primary key
78
-
- All related records (grades, courses, payments) can be linked to this student through the student ID
78
+
- When a student comes to the registrar's office, they can look up their record by student ID.
79
+
- The database can quickly find the student's record using the student ID as the primary key.
80
+
- All related records (grades, courses, payments) can be linked to this student through the student ID.
0 commit comments