Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: about primary key
Hi,
Of course think of sub typing:
Think of an enterpirse that has only one numbering scheme for all docs:
create table document(
doc_number number, name varchar2(50), street varchar2(50), ... ZIP varchar2(50), ... Doc_type number -- describe doc type INVOICE, BILL, LETTER ) ; create tabel Invoice( doc_number number, ... ); create table bill( doc_number number, ... total Number, ... );
The table INVOICE and BILL both contain the field doc_number which is
for both the primary key and also the foreign key related to table
DOCUMENT.
hpcheong_at_ncs.com.sg schrieb:
>
> hi all,
>
> can someone tell me whether the same field in a particular table, be a
> primary key as well as a foreign key to another table at the same time??
>
> pls reply ASAP as this is urgent!
>
> thanks in advance!
>
> rgds,
> evelyn.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
Regards
Matthias Gresz :-)
Matthias.Gresz_at_Privat.Post.DE
Always log on the bright side of life.
http://www.stone-dead.asn.au/movies/life-of-brian/brian-31.htm
Received on Mon Oct 26 1998 - 02:06:47 CST