Hello All,
I'm having some problems laying out a particular table. I'm using PHP and MySQL. I have to record test score for each user with a past history of scores. The number of tests is constantly changing. I'll need to display the data two ways. First, all of the results for a particular test, and second, the top score for each test.
So I was planning on creating a simple table for each user with three columns - the test id#, a datetime stamp, and the score. The only problem that comes to mind is that there is no unique column for a primary key.
But I could use something like this to show a historic list of scores for a particular test id#:
SELECT * FROM table WHERE testid='var' ORDER BY DESC
or this to show the top score for each test id#:
SELECT * FROM table WHERE testid='var' ORDER BY DESC LIMIT 1
So is there a better way to do this?