Results 1 to 15 of 15

Thread: database design

  1. #1
    Join Date
    Jun 2008
    Posts
    2

    Unanswered: database design

    would like advice on creating table (data modeling) for various hardware such as pagers, pcs, etc.... Trying to come up with a good data model where some data (ex: capcode) will be recorded for certain hardware and not others. Is it a good idea to add another table in this case?

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    You'll need a hardware type table, and then type-specific attribute tables for entities that do not share attributes with other types. But really, it's too general and you probably have more questions now, since I can't give you more specifics without you giving us the details of your assignment first
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I would pop this question in the DB Concepts and Design forum - it isn't really a SQL Server implementation issue (although sparse columns in 2008 could come into play....). Let me know if you want it moving.

    Broadly speaking you will be given three options:
    1) Sub type\ super type (as per Robert's suggestion)
    2) One wide table with lots of NULLS in the columns that are not relevant for particular hardware.
    3) EAV (one person will recommend this, everyone else will advise you againsty it)

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    regarding subtypes and supertypes, this is worth a read:

    http://www.sqlteam.com/article/imple...-in-sql-server

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    damn fine article, i hadn't seen it before, but it's the clearest explanation of supertype/subtype i've seen

    thanks

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Oooh - you'll get flamed now by George - he doesn't rate it

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    WTF?

    asdf
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Wrong article poots; the table inheritance one is good, it's the table interfaces one that didn't agree with me.

    Quote Originally Posted by r937
    asdf
    We all love you too, Rudy
    George
    Home | Blog

  9. #9
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    thanks, i do try

    my alternative (to meet the minimum character count) is usually ...

    OMG WTF BBQ??!!1!
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  10. #10
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    Wrong article poots; the table inheritance one is good, it's the table interfaces one that didn't agree with me.
    Ooooh - you still haven't learnt that all the lies and untruths catch up with you one day.
    http://www.dbforums.com/showthread.php?p=6342071

    Sometimes I think I am the last bastion for truth and morality here on DBF.

  11. #11
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I knew you'd go looking for what I said but was certain that you would just see that I had said the interfaces article...

    Will re-read them both when I ind the motivation.
    George
    Home | Blog

  12. #12
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by pootle flump
    Sometimes I think I am the last bastion for truth and morality here on DBF.
    no, you are merely the reigning archivist

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  13. #13
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    Quote Originally Posted by r937
    OMG WTF BBQ??!!1!
    surely you mean LOLWTFBBQ! because OMGWTFBBQ just doesn't make any sense.

  14. #14
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by pootle flump
    Sometimes I think I am the last bastion for truth and morality here on DBF.
    You might have a shot at truth.

    -PatP

  15. #15
    Join Date
    Jun 2008
    Posts
    2
    Thanks guys, i will follow up by asking questions in the DB concepts and design forum.
    You guys are too funny.

Posting Permissions

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