Gavin Brook wrote:
> Personally I use an individual primary key myself. In the past I have seen
> oracle databases with two fields as the primary key, but never a whole
> record.

In a many-to-many relation I often to have something like:
CREATE TABEL author_article {
  authorID INT NOT NULL,
  articleID INT NOT NULL,
  CONSTRAINT author_article_pk PRIMARY KEY (authorID, articleID),
  CONSTRAINT author_fk FOREIGN KEY (authorID) REFERENCES author,
  CONSTRAINT article_fk FOREIGN KEY (articleID) REFERENCES article
);


> One major justification for a single primary key is replication. If you have
> multiple fields as a primary key, on a replicated system, there is a higher
> chance that the same values will appear.

A combination of fields is unique or not, replication has nothing 
to do with that.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183721
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to