๐จโ๐ Students Table Example
| ๐๏ธ StudentID (PK) |
Name |
Email |
๐ AadharNo (AK) |
Phone |
| 101 |
Jethalal |
jethalal@gokuldham.com |
1234-5678-9012 |
9876543210 |
| 102 |
Bhide |
bhide@discipline.com |
2345-6789-0123 |
8765432109 |
| 103 |
Popatlal |
popat@reporter.com |
3456-7890-1234 |
7654321098 |
Key Points:
๐๏ธ Primary Key: StudentID - Uniquely identifies each student
๐ Alternate Key: AadharNo - Unique but not chosen as Primary
๐ฏ Candidate Keys: StudentID, Email, AadharNo - All can uniquely identify records
๐ Enrollment Table Example
| ๐งฉ StudentID (CK) |
๐งฉ SubjectCode (CK) |
Grade |
Semester |
| 101 |
MATH101 |
A |
1 |
| 101 |
PHY101 |
B+ |
1 |
| 102 |
MATH101 |
A+ |
1 |
Key Points:
๐งฉ Composite Key: (StudentID + SubjectCode) - Together uniquely identify records
๐ Foreign Key: StudentID - Links to Students tableโs Primary Key
๐ฆธ Super Key: (StudentID + SubjectCode + Grade) - Includes extra columns but still unique