DB peeps: resolving circular references

Discussion in 'OT Technology' started by teo, Jul 13, 2008.

  1. teo

    teo . => ? => !

    Joined:
    Aug 26, 2004
    Messages:
    3,094
    Likes Received:
    0
    Location:
    Eh?
    Does anyone know of some good references to read up on regarding circular references (ie. why they're bad and how to resolve them)? It's been a while since I did a db course or worked in any depth with db structure and now I need the info for a side project. I know that circular refs are 'bad' but that's about the extent of my knowledge. I also Googled but I've got the wrong search terms because I couldn't find anything that seemed to relate (just stuff for code, not databases). :o

    Basically, I have 4 tables. Each table has a single field as PK. Each table also has a single FK which points to one other table's PK. It's a perfect little cirle, or square I guess. All of the relationships seem necessary to me, and the table structure is about as efficient as I can make it without redundancy. Since I might need to update any of those tables at any given time, I'm guessing I need to break the circle somewhere.

    At the end of the day I mainly want to avoid bad design. I'm writing an app on top of this and I don't want to be bit in the ass later. Please help me edjumacate myself! :wavey:
     
  2. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    What is the model structure that neccessitates that? Why can't you have one table that joins the other 4?
     
  3. teo

    teo . => ? => !

    Joined:
    Aug 26, 2004
    Messages:
    3,094
    Likes Received:
    0
    Location:
    Eh?
    As in, combine the fields and have one happy table? Data redundancy, I guess. The way I designed it, I was trying to get to 3NF. At least what I remember of 3NF. :o

    If you meant something else, it's probably something I haven't thought of and/or don't remember. At this point between sifting through information on the web, trying/failing to come up with other workarounds due to my lack of general db knowledge and just being generally frustrated, I think I've just ended up confused. Feel free to dumb it down if necessary. :p
     
  4. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    It would be better if you just explained what you're trying to design, rather than talk about theoretical practices. I can't think of a reason why the 4th table would have to link back to the 1st table. I'm betting you've over thought this entire process in the design phase.
     
  5. wayno

    wayno New Member

    Joined:
    Mar 12, 2008
    Messages:
    540
    Likes Received:
    0
    Location:
    San Antonio, Texas
    Sounds like you have more than one candidate key, which is suspect 3NF and probably not BCNF. Agree with 5Gen, time to reaquaint yourself with the model.
     

Share This Page