Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Surrogate Keys
I'm in the mud over implementing surrogate keys in master-child tables. For
example,
table master (
master_sug_key number primary key -- generated by nextval
, datam char
)
table child (
child_sug_key number primary key -- generated by nextval
, master_sug_key number foreign key not null
, datac char
)
If I then use ERWin to draw the E-R diagram, I get two independent entities,
unless I also include the
element "master_sug_key" as part of the primary key in the child table,
Should I, should I not, or doesn't it matter? Am I missing something basic
here? The indexes will be fewer if I do include "master_sug_key" in child's
primary key. Any pointers gratefully accepted.
Received on Mon Jul 17 2000 - 14:18:47 CDT