A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Should this be one to Many or Many to Many.. Relationship



 
 
Thread Tools Display Modes
  #1  
Old March 8th, 2010, 01:40 AM posted to microsoft.public.access.tablesdbdesign
Ahmed
external usenet poster
 
Posts: 5
Default Should this be one to Many or Many to Many.. Relationship

Hi,

New to Access learning... I have
Table 1.. Publisher
Table 2.. Books

I was wondering .. Should I create Transient Third Table e.g.
BooksPublisher..
Or Should I put PublisherID key AS Foreign key into Books Table ?
which would be Practical

E.g Books Publishers
BooksNPublishers
Pk BookID Pk PublisherID PK
BookPublisherID

Fk BookID

Fk PublisherID

OR

Publishers Books
PK PublisherID PK BookID
Fk
PublisherID

Could Somebody guide me

Thanks in Advance
Ahmed Khalak


  #2  
Old March 8th, 2010, 02:30 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Should this be one to Many or Many to Many.. Relationship

To answer your question, which of the following do you need to handle:

a) Any book has only ONE publisher.
Therefore a foreign key in the Books table would be enough.

OR

b) A book can have more than one publisher.
Therefore you need the junction table.

In general (a) is adequate. You look on the back of the title page, and you
can discover who the publisher was.

In rare cases, a classic book does get republished by a different publisher.
If you *must* treat this as the same book (e.g. in a large library system),
then you need to use (b).

Another aspect you may want to consider is whether your cataloguing system
should handle resources other than books (e.g. movies, lecturers on video,
music CDs, web pages, ...) If so, you may find it worth thinking through the
angles discussed in this article:
Library resource example
at:
http://allenbrowne.com/AppLibrary.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Ahmed" wrote in message
...
Hi,

New to Access learning... I have
Table 1.. Publisher
Table 2.. Books

I was wondering .. Should I create Transient Third Table e.g.
BooksPublisher..
Or Should I put PublisherID key AS Foreign key into Books Table ?
which would be Practical

E.g Books Publishers BooksNPublishers
Pk BookID Pk PublisherID PK
BookPublisherID

Fk BookID

Fk PublisherID

OR

Publishers Books
PK PublisherID PK BookID
Fk
PublisherID

Could Somebody guide me

Thanks in Advance Ahmed Khalak


 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.