You make the specialty a separate table so that you can enforce referential integrity via a foreign key. There are only a few specialties - and you want to make sure a doctor is associated with one from the list of specialties. If it were an attribute in the doctor table, then a non-existent specialty could be entered, or there could be inconsistency with how the specialty was entered (GP vs General Practioner). A separate table and foreign key removes chance of error/inconsistency.
I hope I can continue watch this course, but unfortunately I have a tough classes this semester >> I'm sure I'll back to all them cuz I have DB class next semester ..
I confused why we separate the specialty from doctors table ??!!1
You make the specialty a separate table so that you can enforce referential integrity via a foreign key. There are only a few specialties - and you want to make sure a doctor is associated with one from the list of specialties. If it were an attribute in the doctor table, then a non-existent specialty could be entered, or there could be inconsistency with how the specialty was entered (GP vs General Practioner). A separate table and foreign key removes chance of error/inconsistency.
mlzellers 5 months ago
@mlzellers thanks a lot :)
memo430 5 months ago
a great interpretation Prof ..
I hope I can continue watch this course, but unfortunately I have a tough classes this semester >> I'm sure I'll back to all them cuz I have DB class next semester ..
I confused why we separate the specialty from doctors table ??!!1
memo430 5 months ago