Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2011

    Table Design Assistance

    I'm hoping this will be an easy one. I'm planning on building an application that tracks the physical location of objects. So far, I'm thinking that i can create a table called containers and allow the user to create the containers. Then associate the object with that container. Where it is getting a little tricky for me is that some containers will be inside other containers. I'm considering everything a container. A building, floor, room, cabinet, draw, etc. I want my user to be able to create all these elements as they see fit. The first container they will create will be the building. The user can then create sub containers if they are needed. In some instances the object might be stored in building_a/first_floor/room_b/cabinet_c/drawer_3/slot_2 (6 containers). In other cases it might just be building_a/basement/bin_v (3 containers). Only the top level container will be linked to an address table. All sub containers would be assumed to be at the same location that it's parent container is in so I should be able to write sql to get that info. I made a quickie erd to try and show what I'm thinking (please ignore the naming).
    Does this seem to be a good approach?
    Should I Create a separate table for the buildings?
    Any input would be greatly appreciated.

    Attached Thumbnails Attached Thumbnails object_draft.png  

  2. #2
    Join Date
    Sep 2002
    The model looks OK to me. You will want to add a constraint that only top-level containers can be associated with an address.

  3. #3
    Join Date
    Aug 2011
    Thanks for the feedback Tony, I appreciate it.


Posting Permissions

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