![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
On 26/07/2012 04:28:59, "David Hare-Scott" wrote: Bob Quintal wrote: The Frog <Mr.frog.to.you (AT) googlemail (DOT) com> wrote in news:almarsoft.5924047734445792180 (AT) news (DOT) aioe.org: Multi field primary key? Nope. I would do it a little differently though, but same effect. Use an auto number for the primary, and unique index on the multi field. Same same, but different. Just makes it easier if you have external data to relate to it. An autonumber field in any table is a violatiuon of the first normal form. They are a workaround to taking the time and effort to identify the real key. Only if you are religious. ;-) D Surely we all use it most of the time in a join table. EG Person table Hobby table JnPersonHobby which has a unique key, no duplicates PersonID HobbyID This allows 1 person multiple hobbies and 1 hobby with lots of participants, but you can't enter a hobby twice for one person Phil |
#12
| |||
| |||
|
#13
| |||
| |||
|
|
I would have to say that using a synthetic key provides me better solutions than natural keys. Phil's approach is simply a demonstration of that. The classic case where a natural key fails is two people with the same name at the same location etc... How far do you take a natural key to create a unique capture of data before it becomes ridiculous? Down to the DNA? A natural key is only useful if its practical. A synthetic key allows you to capture the logic of the problem without unnecessary added complexity. It's a practical solution to real world problems. |
#14
| |||
| |||
|
|
On 26/07/2012 04:28:59, "David Hare-Scott" wrote: Bob Quintal wrote: The Frog <Mr.frog.to.you (AT) googlemail (DOT) com> wrote in news:almarsoft.5924047734445792180 (AT) news (DOT) aioe.org: Multi field primary key? Nope. I would do it a little differently though, but same effect. Use an auto number for the primary, and unique index on the multi field. Same same, but different. Just makes it easier if you have external data to relate to it. An autonumber field in any table is a violatiuon of the first normal form. They are a workaround to taking the time and effort to identify the real key. Only if you are religious. ;-) D Surely we all use it most of the time in a join table. EG Person table Hobby table JnPersonHobby which has a unique key, no duplicates PersonID HobbyID This allows 1 person multiple hobbies and 1 hobby with lots of participants, but you can't enter a hobby twice for one person Phil |
#15
| |||
| |||
|
|
The Frog <Mr.frog.to.you (AT) googlemail (DOT) com> wrote in news:almarsoft.5924047734445792180 (AT) news (DOT) aioe.org: Multi field primary key? Nope. I would do it a little differently though, but same effect. Use an auto number for the primary, and unique index on the multi field. Same same, but different. Just makes it easier if you have external data to relate to it. An autonumber field in any table is a violatiuon of the first normal form. They are a workaround to taking the time and effort to identify the real key. -- Bob Q. PA is y I've altered my address. |
![]() |
| Thread Tools | |
| Display Modes | |
| |