If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Many-to-Many problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-28-09, 13:46
apiccion apiccion is offline
Registered User
 
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.
Reply With Quote
  #2 (permalink)  
Old 08-28-09, 13:50
Thrasymachus Thrasymachus is offline
SQL Server Street Fighter
 
Join Date: Nov 2004
Location: Down The Rabbit Hole
Posts: 7,979
why yes there is.

table: course
course PK

table: book
ISBN PK

table: course2book
course
ISBN
__________________
software development is where smart people go to waste their lives
Reply With Quote
  #3 (permalink)  
Old 08-28-09, 13:55
apiccion apiccion is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 08-28-09, 13:58
apiccion apiccion is offline
Registered User
 
Join Date: Aug 2009
Posts: 5
Or... in the table book2course, should I use a two-column PK (course, isbn)?
Reply With Quote
  #5 (permalink)  
Old 08-28-09, 14:15
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
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"
Reply With Quote
  #6 (permalink)  
Old 09-03-09, 07:12
raghavshukla raghavshukla is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On