I think this is certainly a big question. I had to create systems that have a similar situation with this, especially when a table with ratings in it is available quite often (for example, in your scenario). Here is my suggestion for you:
First, create some tables like the following (I use SQL Server best practices, but call them what you think is right):
UserAccount UserAchievement
-Guid (PK) -Guid (PK)
-FirstName -UserAccountGuid (FK)
-LastName -Name
-EmailAddress -Score
, , (, SQL, ):
SELECT [UserAccount].[FirstName] AS FirstName,
[UserAccount].[LastName] AS LastName,
SUM([UserAchievement].[Score]) AS TotalPoints
FROM [UserAccount]
INNER JOIN [UserAchievement]
ON [UserAccount].[Guid] = [UserAchievement].[UserAccountGuid]
GROUP BY [UserAccount].[FirstName],
[UserAccount].[LastName]
ORDER BY [UserAccount].[LastName] ASC
, , , . ; , ( , UserAccountGuid) .
- UserAccount , , , . -, 3-10 . , , "IN", .