PDA

View Full Version : E-R Diagrams


anandpocham
Nov 20, 2006, 10:21 PM
Hi,

My Question 1 is, When we are trying to give a relation with Foreign key referencing only a part of the composite key, it is not accepting the relation. Is it possible?

2. The Foreign key referencing the primary key of multiple tables referencing only one table at a time, is it possible?

ScottGem
Nov 21, 2006, 07:31 AM
First I am not a fan of composite keys. It just makes building relations that much harder. A PK should be a unique identifier used internally by the database. While I don't go so far as some to state the PK should be hidden from the user, it should have no relation to real data. By using such a PK you remove the problem of relations with composite keys.

I don't understand the second question.