SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,092
    Mentioned
    55 Post(s)
    Tagged
    0 Thread(s)

    One to one relationships

    When is it beneficial at all to create a seperate table for a one to one relationship? I've got a db with thousands of records. I have about 5-10 employees who will be assigned these records. Each week about 300-500 ne records will be added / dropped, requiring a script to assign these. Is it good / bad practice to put the assignedTo field on a seperate table?

    Also. I'm running this db in access, about to switch to SQL server. Each record has a status that must be limited to 10 or so text responses. Should I change this to a number code with a relationship linking that number code to the text version of the status? Or can I continue to rely on code / db design to limit responses to my given selection.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,021
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    i don't think you need to bother with a separate table

    just update the assignedTo column directly

    regarding your second question, i think it's largely a question of application simplicity whether you want the added complexity of a surrogate key for the text messages

    i would still have a second table, to ensure that only authorized texts are used (via foreign key check), but a few extra bytes per row in space, for a few thousand rows, is not going to substantially affect your total space requirement (not in this day of terabyte drives), but it will allow you to avoid an extra join to retrieve the text for every query that needs it
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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