Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Posts
    5

    Many-to-Many problem

    Hello, I am new to database design.

    I have the following problem: I need to keep track of which university courses go with which textbooks(ISBN). However, one course can require multiple textbooks; similarly, one textbook can be used in multiple courses.

    The solution I've designed is:

    course(PK)
    ISBNlist

    Where ISBNlist is a string of comma delimited ISBN numbers.

    Is there a better solution to this problem?

    Thank you.

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    why yes there is.

    table: course
    course PK

    table: book
    ISBN PK

    table: course2book
    course
    ISBN
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Aug 2009
    Posts
    5
    Hello, thank you for your help.

    I just want to make sure, it's okay to make tables with no PK?

  4. #4
    Join Date
    Aug 2009
    Posts
    5
    Or... in the table book2course, should I use a two-column PK (course, isbn)?

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Yes, using the two-column pk is one good solution.
    If it's not practically useful, then it's practically useless.

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

  6. #6
    Join Date
    Sep 2009
    Posts
    1
    well here is what you should begin with?
    1. first of all start thinking about NORMALIZING your database.Because using delimitors is not only bad database design rather its also inefficient. Straight forwardly "ISBN's Should Never Be Comma Seperated".Atleast Normalize your Database to 3NF

    Once you are done with this , I am sure your will find solutions to all your problems

Posting Permissions

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