----- Original Message -----
Most of the inheritance i've seen done in databases
retain the parent primary as a foreign key and a primary key. That being
said, only you and your team can decide if more than one object will extend a
base class. If you were doing something more like this
person -> sweepstakes entry
to model a sweepsakes entry is a person, and
you allow a person to enter a sweepstakes more than once, but to enter a contest
the user must provide a unique email address, then you could not just use a
foreign key as the primary key in sweepstakes, since the primary key would
disallow multiple entries in sweepstakes entry, you would then use a serial
data type in both person and sweepstakes along with the foriegn key in
sweepstakes from person.
The answer depends on the need. Hope that
helps.
Russ |
- Re: [SQL] Design problemi : using the same primary keys f... Russell Simpkins
- Re: [SQL] Design problem : using the same primary ke... David Pradier
- Re: [SQL] Design problem : using the same primar... Daryl Richter
- Re: [SQL] Design problem : using the same pr... David Pradier
- Re: [SQL] Design problem : using the same primar... Russell Simpkins
- Re: [SQL] Design problem : using the same pr... David Pradier
- Re: [SQL] Design problemi : using the same primary k... codeWarrior
- Re: [SQL] Design problemi : using the same prima... David Pradier
- Re: [SQL] Design problemi : using the same p... Richard Huxton