Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > General > Database Concepts & Design > design of mysql db behind site

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-23-08, 07:21
djemmers djemmers is offline
Registered User
 
Join Date: Jun 2008
Posts: 6
design of mysql db behind site

Hi,

I have a site that gives an oversight of sport tournaments in 2 countries.
It stores the tournaments in a sql db wich is editable with phpmyadmin.

Now I want to expand the site to not only tournaments but also camps, lessons,... in the sports.

While thinking about that I realised that the desing of the db that should store all the those sport events isn't that straightforward anymore and that I could use some help with it.

here is what it should have:

3 categories: camps, tournaments, lessons.
sports: volleyball, soccer, basketball,...

as I see it there ar 2 options but I wonder what is best?

db1: all the events in one table,
but with options I will add later on (language, country,...) I am affraid that it will become a verry large table and as a result slow to search/edit and so on?

db2: a seperate table for eact category:
looks better, but I still wonder if this is the way to go.

Any help or suggestion is welcome.
keep in mind that I expect those tables to become large..( hundreds per sport per category)
Attached Thumbnails
design-mysql-db-behind-site-db1.gif  design-mysql-db-behind-site-db2.gif  

Last edited by djemmers : 06-23-08 at 07:26.
Reply With Quote
  #2 (permalink)  
Old 06-23-08, 07:50
mike_bike_kite mike_bike_kite is online now
Registered User
 
Join Date: Jun 2007
Location: London
Posts: 944
One table and make sure you just have fields to describe
  • type of sport i.e. basketball, soccer …
  • type of event i.e. tournament, camp, lesson …
  • country:
The above fields could have FK lookups to ensure their values are correct.

Then just make sure your indexing is correct. Most of us have tables with many millions of records and performance is rarely a problem unless the indexes are poorly defined. Speed to run won’t be much different between your “one table” and “many table” approaches but the speed to develop the application and maintain it in future will be much better with your “one table” approach.

Mike
Reply With Quote
  #3 (permalink)  
Old 06-23-08, 08:20
djemmers djemmers is offline
Registered User
 
Join Date: Jun 2008
Posts: 6
tnx for your clear reply.
but what do you mean by the following ?
Quote:
Originally Posted by mike_bike_kite
The above fields could have FK lookups to ensure their values are correct....
Then just make sure your indexing is correct.
Reply With Quote
  #4 (permalink)  
Old 06-23-08, 08:40
mike_bike_kite mike_bike_kite is online now
Registered User
 
Join Date: Jun 2007
Location: London
Posts: 944
You just want to have some validation on these fields to ensure that users put the right values in. This might ensure that you just have soccer in your database rather than some users entering soccer, some football, and others entering footy or foot ball etc. You can do this via foreign keys (FK) where you just put all the allowed values into a lookup table and the foreign key ensure whatever value goes into your main table is one of these values.

Obviously if you’re producing a web front end to your system then you can just populate a select option on your form so the user only has these values to select.

Mike
Reply With Quote
  #5 (permalink)  
Old 07-07-08, 04:33
djemmers djemmers is offline
Registered User
 
Join Date: Jun 2008
Posts: 6
Hi, I moved into my new house so didn't have internet for a while, hence the delay...
I am producing a web front for it, here a new pic.
Does this look ok to you guys ?
2 things I am struggling with:

* Language: now everything is only in dutch (belgium and the netherlands) but If all goes well I would like to expand to germany, france,...
so i will need the table languages. Now I have put language_idlanguage in every table. I think that would be ok...

* eventsort: every event has depending on the category and sport different possibilities for eventsort 1 to 5...
Do I store the ideventsort in table event (under eventsort1 to 5) or do I store the value of the eventsort (name from eventsort)

hope my questions are clear...
Attached Thumbnails
design-mysql-db-behind-site-tournament.gif  
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

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