|
|
|
|
|
by brianwawok
3666 days ago
|
|
Okay so you run a school and want to make a students database. What do you use a a PK? 1) Social security #? Fails when you have international student. 2) Last Name, First Name, Middle Name? Fails when you have a repeat name. 3) Last Name, First Name, Middle Name, Home Town, Start Year? I guess this works for most of the time. Now you need to join to this table from the classes table. So now you need all 5 keys duplicated in the classes table to do the join. Simple Integer primary keys "suck" in that you are adding bogus data to your database that has no value.. but man, they sure solve a LOT of problems. You need to think fairly hard before you get rid of them. In some cases you totally can. But making your default datamodel include an Integer PK solves a LOT of problems. |
|