Reputation: 49
Provide a set of MySQL specific CREATE TABLE statements that implement tables for the following entities including the FK relationships implied by the associations. Note that each GamePlayed is associated with a Player and Game.
What will be the primary key in each table? and what does 0..N means in this diagram?
Upvotes: 0
Views: 385
Reputation: 34231
Use generated id (i.e. auto increment field) in game and player tables as primary key. Use these 2 fields together as a primary key in gameplayed table.
0..n means that for each record in the parent table you can have 0 or unlimited number of corresponding record in the child table.
Upvotes: 1