Multiple Foreign keys from 1 child to 1 parent discussion
Posted by: Philip Curtis
Date: June 06, 2016 12:43PM

I have a database, which was designed by developers, where one table, a (bill) table has numerous foreign keys (4) into a parent table (user).

The user table has a primary key on the field named id.

The bill table has the following foreign key constraints:
1) assigned_to references user (id)
2) user_id references user (id)
3) referring_user_id references user (id)
4) rendering_user_id references user (id)

Now, the above looks horrific to me, but aside from the locking that could occur as the heavily accessed user table is checked. Could someone actually
tell me, so that I can educate my developers, what really is the problem with this kind of preponderant use of foreign keys?

As a side note, and I don't mind comments, the bill table is not a direct child of user, encounter is a direct child of user and is the real parent of bill and there is a foreign key from bill to encounter.

So, we have the chance for a user_id to be different it traced through encounter or directly to user.

This table, bill, actually as 11 foreign keys: your comments would be appreciated.

Thank you

Options: ReplyQuote


Subject
Written By
Posted
Multiple Foreign keys from 1 child to 1 parent discussion
June 06, 2016 12:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.