Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2016
    Posts
    22

    Answered: Relationship best practice

    Hello all,

    I have a question about best practice on relationships. Essentially, (and this is my own language, it may not be correct database language) do relationships need to be define in a circle or is a linear relationship enough?

    Here is a visual example:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	5 
Size:	43.1 KB 
ID:	17260

    In this example, I have InventoryMasterT table with a BarcodeID variable. That variable (column) has a relationship with 3 other tables, InventoryMovement, InventoryHistory, and InventoryBalance.

    As I set up the relationships, I connected every instance of Barcode with every other instance. Is this necessary? Is it enough to connect the MasterT with the other 3, or should I do what I did and create the 'circle' where every instance is connected to every other instance?

    Just wondering what the best practice is for database design.

    Thank you in advance!

  2. Best Answer
    Posted by weejas

    "Circular relationships can cause weird things to happen.

    If your example, you only the master table needs to be linked to all the others. The history, movement and balance tables do not need to be linked to each other."


  3. #2
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    1,101
    Provided Answers: 17
    Circular relationships can cause weird things to happen.

    If your example, you only the master table needs to be linked to all the others. The history, movement and balance tables do not need to be linked to each other.
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

  4. #3
    Join Date
    Dec 2016
    Posts
    22
    Thank you. I wasn't sure what is enough or too much. I will clean that up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •