Database Question

Discussion in 'OT Technology' started by kevlar8, Dec 5, 2005.

  1. kevlar8

    kevlar8 Do or do not, there is no try.

    Joined:
    Jan 31, 2002
    Messages:
    2,163
    Likes Received:
    0
    Location:
    Pittsburgh, PA
    I am working on a database project for school. One of the things we have to do is look at the db and decide if there is anything to be done to make it more efficient. The one thing I saw was 2 'validation' tables with only a pk and one other column. I was wondering how I can decide if these tables can be merged with their connected table. Any help would be cool. I can answer some questions if you need more info.
     
  2. skippytpe

    skippytpe New Member

    Joined:
    Aug 9, 2005
    Messages:
    60
    Likes Received:
    0
    Location:
    Memphis, TN
    I'm assuming that the PK becomes a foreign key in more than one table? If that is the case, then this is proper normalization (technically they are join tables at that point).
     
  3. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,915
    Likes Received:
    8
    Location:
    Los Angeles
  4. kevlar8

    kevlar8 Do or do not, there is no try.

    Joined:
    Jan 31, 2002
    Messages:
    2,163
    Likes Received:
    0
    Location:
    Pittsburgh, PA
    its a foreign key in the one table that i was thinking about merging it with.
     
  5. skippytpe

    skippytpe New Member

    Joined:
    Aug 9, 2005
    Messages:
    60
    Likes Received:
    0
    Location:
    Memphis, TN
    Sounds like a winner to me. You'll lose a little advantage in size (I'm guessing that the column that isn't a PK also isn't a number), but you should shorten processing time when it comes to queries.
     
  6. kevlar8

    kevlar8 Do or do not, there is no try.

    Joined:
    Jan 31, 2002
    Messages:
    2,163
    Likes Received:
    0
    Location:
    Pittsburgh, PA
    I browsed that tutorial kingtoad, thanks for the link but i still have trouble with this one.

    To get more specific the two tables in this hospital db are:

    ----------Bed type------------------------Bed
    PK-------bed type id----------------------bed number
    other----bed description------------------ .............

    Now can i merge bed description with the bed table because each bed has only one description.
     
  7. kevlar8

    kevlar8 Do or do not, there is no try.

    Joined:
    Jan 31, 2002
    Messages:
    2,163
    Likes Received:
    0
    Location:
    Pittsburgh, PA
    Sweet. Do you still think so after seeing my above post?
     

Share This Page