What should be the database structure?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rizwan6feb
    New Member
    • Jul 2007
    • 108

    What should be the database structure?

    I am trying to design a database but not sure about the structure, please help. Consider the following scenario

    I have to store data about the following entities

    1. Building (Building Name, Building Code)
    2. Floors (Floor Name, Floor Number)
    3. Rooms (Room Name, Room Number)
    4. Equipment (Equipment Name, Equipment Code)

    with the following constraints

    Floors are associated with Buildings (i.e Floors exist in Buildings)
    Rooms are associated with Floors (i.e Rooms exist in Floors)

    and Finally

    Every Equipment is assigned a code and Equipment can be associated with Building, Floor or Room

    Thanks in Advance
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    This looks like a homework assignment

    But I would say that the entities you describe would make perfect tables
    1. Building (Building Name, Building Code)
    2. Floors (Floor Name, Floor Number)
    3. Rooms (Room Name, Room Number)
    4. Equipment (Equipment Name, Equipment Code)
    With the addition of a unique ID for each record.

    As for the associations, are you referring to relationships?
    Must admit I am rusty on this subject,
    I let my queries handle the relational links nowadays.

    Looks a quite interesting, but fairly simple assignment.

    Comment

    • rizwan6feb
      New Member
      • Jul 2007
      • 108

      #3
      Thanks for your reply, this is not an assignment. Its is a part of project i am working on

      Originally posted by code green
      But I would say that the entities you describe would make perfect tables
      1. Building (Building Name, Building Code)
      2. Floors (Floor Name, Floor Number)
      3. Rooms (Room Name, Room Number)
      4. Equipment (Equipment Name, Equipment Code)
      With the addition of a unique ID for each record.
      The above database structure does not cater the following point

      Every Equipment is assigned a code and Equipment can be associated with Building, Floor or Room (i.e Equipment can be found in Building, Floor or Room)

      Comment

      Working...