Right guys, I have a score that can be just ONE of several types

eg.

the score can be a time eg. 01:56.78 (does MYSQL 5.0 now show the
fractional part?)

or a count eg. 56, 31 etc

or a count and a subcategory (just a bit of text) eg. (56, "Variety"),
(31, "No Weapon")

A score can belong to just one category.
A score has one and just one player.

What is the best way to model the score? Ideally I want to be able to
join score, player and category so I can get a flat list of scores for
a player and the category, regardless of how the score is "typed".

My bodge solution is to have a score table thus:

score:
score id
category id
player id
type
time char(8) - type of 'time' in 5.0.16 does not show the fractional part :-/
count
subcategory

Thus for the scores where there is just a time, then type=1 and count
and subcategory are NULL. Where the score is a count and subcategory,
then type=2 and time is NULL.

I want to aim for 3NF and this seems ugly solution, there must be an
elegant way to do this?

Thanks,
Imran Chaudhry

--
http://www.atomdatabase.com
MySQL Database Management & Design Services

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to