Re: Circular FK's

  • From: david wendelken <davewendelken@xxxxxxxxxxxxx>
  • To: Oracle-L Freelists <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 4 Nov 2005 10:55:22 -0500 (GMT-05:00)

>Has anyone ever seen a reason for two tables to have foreign keys on
>each other (different columns)? 

Yes!

Multi-company accounting system, with "company" as the primary table.
Almost every other table had a FK (direct or indirectly via another table) to 
it.
This included some reference code tables, as different companies might want 
different sets of reference codes for the same purpose.

The company table had optional fks to some of the reference tables in order to 
store "default" reference codes for certain purposes.

Now, I will grant you that it probably would have been better to split that 
portion of the company table into a separate table to simplify the DBA's work 
later, but we learn by doing - sometimes well after we did it... :) 


--
//www.freelists.org/webpage/oracle-l


Other related posts: