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 > Newbie's Q: Many to many relationship

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-04, 14:22
brillo brillo is offline
Registered User
 
Join Date: Aug 2004
Posts: 1
Newbie's Q: Many to many relationship

Hi. I'm designing essentially my first semi complicated (least from my standpoint) database and had a couple questions. It's a listing of parenting classes offered by various organizations around my town, and I'm using (and learning) MySQL.

I'm having a hard time really understanding how to go about one aspect of this. I have a number of organizations, each with one or more classes, and each class has one or more topics it deals with, such as parenting teens, or parenting after a divorce. So far I have four tables:

organizations: org_id(PK), org_name, org description, org_address, etc...
classes: class_id(PK), org_id, class_name, class_description, class_cost, etc...
class_types: type_id(PK), category

I'm pretty clear on the relationship between the orgs and classes. Just a one to one relationship right?

I'm struggling with setting up the relationship between the class and the categories it belongs to. Can anyone give me any pointers? I understand you usually set up a fourth table right? It would have just the two other primary keys like this: classes_class_types: class_id(PK) and type_id(PK) right?

I know this is probably simple, but I'm still just learning.

Thanks for the help.
Reply With Quote
  #2 (permalink)  
Old 08-06-04, 09:25
MattR MattR is offline
Registered User
 
Join Date: Mar 2001
Location: Lexington, KY
Posts: 606
Quote:
Originally Posted by brillo
classes_class_types: class_id(PK) and type_id(PK) right?
Right.

And I have to make my reply at least ten characters, hence this sentence.
__________________
Thanks,

Matt
Reply With Quote
  #3 (permalink)  
Old 08-10-04, 22:28
roman2 roman2 is offline
Registered User
 
Join Date: Aug 2004
Posts: 17
Quote:
I'm pretty clear on the relationship between the orgs and classes. Just a one to one relationship right?
Isn't it a one-to-many relationship?
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