|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Relational DB Structure
I have a successful site running using a flat database. Due to hits and infoI know require, I am trying to
change to a relational database.The site is an athletics results site in the uk. I want to be able to show results by athlete, club, country, meeting and event. I also want to mark performances as to which Grade (1-4) they equal, and show if they break a record and ranking in the UK all time list. A lot, hence the move from a flat table to relational database. The structure I have designed is flawed- I think normalisation is wrong or I may have errored on relationships. ( I am testing in access, though will be using mysql on the site. Table1 : Athlete ~athid ~athfnam ~athsurnam ~club id ~country id ~sex Table 2 : Club ~Club ID ~club name ~club county ~club country ~club web ~club email ~ath id Table 3 : Country ~country id ~country name ~club id ~athlete id Table 4 : results ~results id ~athlete id ~event id ~performance ~date ~meeting Table 5 : events ~ event id ~ event name ~ event age group ~ event type (indoor or outdoor ? should I have a seperate table ?) Table 6 : Records ~records id ~ event id ~country id ~performance Table 7: Grade ~grade id ~ grade name ( i.e grade 1, 2 , 3 ,4) ~event id ~performance ( between or under to figures i.e grade 2 might be from 8.0 to 8.5) Table 8: Meeting ~meeting id ~meeting name ~meeting date ~location ~county id Table 9: UK ALL TIME LISTS ~ alltime id ~ ath id ~ event id ~ performance. I cannot get this to work, I am new to the relational database concept, so may have made errors in table design. Any siggestions would be welcome. Thanks charles |
|
#2
|
|||
|
|||
|
Just as a quick look, Country should not have club_id or ath_id and Grade should not have event_id.
|
|
#3
|
||||
|
||||
|
Curious... Why does club have two country fields?
~club county ~club country |
|
#4
|
|||
|
|||
|
county and country
One is County, say Hampshire ( as in state, say BC) other Country as in Canada
Quote:
|
|
#5
|
|||
|
|||
|
Grade
Grade realtes to event- i.e take U15G 60m- time under 8.0 = Grade 1, btween 8.5 = Grade 2- I added the evnt ID because each event has a
different standard- U13 G 60m Grade 1 might be under 8.4. So I though I would have to relate each event with a grade. Maybe the grade table is not well explained- I will have about 200 different standards acrooss ages and events. Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Relational DB Structure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|