Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: foreign key?

Re: foreign key?

From: PaulCinVT <paulcinvt_at_aol.com>
Date: 30 Nov 1999 20:54:46 GMT
Message-ID: <19991130155446.00976.00000241@ng-cg1.aol.com>


>>

No. A foreign key must always refer to the primary key of the parent table.

Tim
<<
Not exactly correct...check out Oracle's documentation on definition of referenced key...it could be a unique key instead of a primary key...

FOREIGN KEY (Referential) Integrity Constraints Different tables in a relational database can be related by common columns, and the rules that govern the relationship of the columns must be maintained. Referential integrity rules guarantee that these relationships are preserved.

Several terms are associated with referential integrity constraints:

foreign key
 The column or set of columns included in the definition of the referential integrity constraint that reference a referenced key (see the following).  

referenced key
 The unique key or primary key of the same or different table that is referenced by a foreign key.  

dependent or child table
 The table that includes the foreign key. Therefore, it is the table that is dependent on the values present in the referenced unique or primary key.  

referenced or parent table
 The table that is referenced by the child table's foreign key. It is this table's referenced key that determines whether specific inserts or updates are allowed in the child table.    

A referential integrity constraint requires that for each row of a table, the value in the foreign key matches a value in a parent key.

Paul in VT Received on Tue Nov 30 1999 - 14:54:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US