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 > help on many to many relationships 3NF

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-16-07, 04:19
alexyeth alexyeth is offline
Registered User
 
Join Date: Jun 2007
Posts: 27
help on many to many relationships 3NF

HI everybody.. need help on my database normalization design...

we have 2 tables which has many to many relationships the first has this fields

clients
CLIENTID CLIENTNAME
1 A
2 B

second table

pubblications
PUBID DESCRIPTION
1 PUBA
2 PUBB

these two has many to many relationship since client can have many pubblications and pubblications have many clients

I MADE A JUNCTION TABLE TO DEAL WITH IT...
table name clientpubs
the fields for the junction are
CLIENTID AND PUBID

MY PROBLEM IS IF it is possible to add more fields to the junction table for tyhe subscription like COUNT AND LANGUAGE or is it better to make a details table tab will INCLUDE
CLIENTID
PUBID
COUNT
LANGUAGE
ETC

thanks
alex
Reply With Quote
  #2 (permalink)  
Old 07-16-07, 06:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by alexyeth
MY PROBLEM IS IF it is possible to add more fields to the junction table
yes, it is
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 07-16-07, 07:10
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
I do wonder why you want a count field though...
Note that Cont is a reserved word too!
__________________
George
Twitter | Blog
Reply With Quote
  #4 (permalink)  
Old 07-16-07, 07:12
alexyeth alexyeth is offline
Registered User
 
Join Date: Jun 2007
Posts: 27
if adding more fields to a junction table is alright like count etc... which would be better to add more fields or to create a another table detailing the subscription detail with the following fields?

CLIENTID
PUBID
COUNT
LANGUAGE
ETC
Reply With Quote
  #5 (permalink)  
Old 07-16-07, 07:14
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
add more columns -- the additional table is unnecessary overhead
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 07-16-07, 07:17
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Just think - is this 1:1, 1:M or M:M - and bingo - there's your answer
__________________
George
Twitter | Blog
Reply With Quote
  #7 (permalink)  
Old 07-16-07, 07:30
alexyeth alexyeth is offline
Registered User
 
Join Date: Jun 2007
Posts: 27
thanks georgev i overlooked that count is a reserved word so i have to rename it..

while for rudy so will be adding fields to the juntion table for the many to many relationship and for the primary key will it be the composite of CLIENTID AND PUBID OR WILL it be better to create a primary key column with type numeric?
Reply With Quote
  #8 (permalink)  
Old 07-16-07, 07:40
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
composite.
__________________
George
Twitter | Blog
Reply With Quote
  #9 (permalink)  
Old 07-16-07, 07:48
alexyeth alexyeth is offline
Registered User
 
Join Date: Jun 2007
Posts: 27
thanks will try that..
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