views:

64

answers:

0

Hi, I am new to Core Data, and have been trying to figure out how to set up my data model. I made a sample table to try and show how I need the data to relate.

First Name Last Name Competitor Number Gender Team Competition Game Name     All Time high Competition Scores 
Jon         Doe            1          M  Gamers     January   Donkey Kong       Lvl 5         Level #         1 2 3 4
                                                                                       Trys to complete    1   0 1 3
                                                             Pac Man        8000               game 1   7000      
                                                                                              game 2   8500      
                                                                                              game 3   9000      
                                                       March  Donkey Kong         Lvl 5        Level #        
                                                                                             trys        
                                                             Pac Man                         Game 1        
                                                                                              Game 2        
                                                                                              Game 3        
     Bob        Smith       2              M Players   January    Asteroids        34000            Game 1    30000      
                                                                                              Game 2   20000      
                                                                                              Game 3   10000      
                                                              Pac Man          7000           Game 1       5000      
                                                                                              Game 2    4500      
                                                                                              Game 3    7000  

From what I have read I think I need entities for Players, Competitions, GameNames. With To-Many relationships between players and competitions and gameNames, also a relationship between gameNames and competitions.

And then attributes of First Name, Last Name, competitor number, gender, team for players. Attributes for competition would be month (or name), Attributes for GameName would be name.

And then I get stuck I don't know if the all time high should be an attribute of GameName because it needs to be associated with the individual player, and players will have different high scores for different games. I need to be able to keep track of number of tries and the highest level for games like donkey kong, so would I make attributes of game1, game2, game3? But other games like pac-man I only care about the end score. So would game1, game2, game3 be attributes of the player or the game? or should it be an entire entity by itself?

thanks for any help.