Designing a game database
- by Ronald
I'm trying to design a database to record game histories for a game I'm working on. I have 3 different tables: users, gamehistories, and gamescores. 
Columns for tables: 
users: uid, displayname, email 
gamehistories: gid, pubID, start (datetime), end (datetime) 
gamescores: gid, uid, score 
I am trying to produce the following result set given a userID (uid): 
Opponent's displayname, my score, opponent's score, duration
Any ideas? Is my design ok? How can I query these tables to get game histories for a given uid?