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 > Database Server Software > MySQL > Database design help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-18-10, 17:52
Pspeters Pspeters is offline
Registered User
 
Join Date: Nov 2010
Posts: 1
Database design help

I am building a site where people can post items for sale in different groups (Clubs, organizations, etc). On the main page they will search for their group and when they select it, it will take them to the group portal which displays the items specifically posted to that group. If their group isn't there, then they can add it.

I am pretty new to MySQL. All i could think of doing for when people add their group is...

1. Create a table for the groups info and assign the name, id, etc.
2. Automatically create a new table called group[id]. I then can get the ID from querying the NAME and then access the group[id] table with posts. This way of doing it is extremely limited and cluttery... My database is looking like
group46
group47
group48
group49
etc...

Does anyone have any suggestions?
Thanks!
Reply With Quote
  #2 (permalink)  
Old 11-19-10, 08:23
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by Pspeters View Post
This way of doing it is extremely limited and cluttery...
i can definitely confirm that

a table for groups is fine

the other table would hold items for all groups, with a foreign key for the group that each item belongs to
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Tags
database, design, mysql

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