Results 1 to 3 of 3

Thread: database design

  1. #1
    Join Date
    Feb 2013
    Posts
    2

    database design

    Hello, I'm quite new to databases and am doing a project which is creating a library management system and just want some advice.

    There will be different types of media available (book,journal,dvd).

    My question is which method would be better,

    1. Have a media table where all common attributes are located

    or

    2. Have tables for each media type?

    And would I have to make a table for the multiple copies of each media?

    Any advice would be appreciated and thanks in advance.
    Last edited by TeaJay; 02-26-13 at 20:26.

  2. #2
    Join Date
    Feb 2013
    Posts
    2
    Used the first method and got this:

    http://img401.imageshack.us/img401/7013/db1m.png

    I'm still not sure how to do the attributes for each media that are only for that specific type

    eg. book has isbn but journal has issn, etc

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    There's no good way to handle this, unfortunately.
    If most attributes are shared between media, and you don't anticipate adding more media types, then store all the attributes in the same table and leave the unused ones as NULLs.

    Otherwise, consider creating an XML column to store the media-specific data.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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