From: Bud P. B. <bu...@si...> - 2003-04-11 13:45:47
|
On Fri, 11 Apr 2003 08:23:51 -0500 Brad Bollenbach <br...@bb...> wrote: > In either case, this will not affect anything in comments, because > this is a table that would probably look like: > > Comments > comment_id > comment_desc > ... > etc. If this is your comments table, there are no problems. However, the problem I try to illustrate uses the following table: CREATE TABLE ProjectWorkerComment( project_id INT, worker_id INT, comment_id INT, PRIMARY KEY (project_id, worker_id, comment_id), FOREIGN KEY (project_id, worker_id) REFERENCES ProjectWorker); It may not be a realistic example, but I was attempting to quickly think of something to add additional levels to the hierarchy of composite foreign key relationships. If you have such a hierachy, changing relationships at a higher level (for business logic reasons) implies that you change the composite keys of all related tables at lower levels. --b |