Subayyal Mustafvi
Subayyal Mustafvi

Reputation: 49

MySQL CREATE TABLE statement from diagram

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.

Diagram here

What will be the primary key in each table? and what does 0..N means in this diagram?

Upvotes: 0

Views: 385

Answers (1)

Shadow
Shadow

Reputation: 34231

  1. 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.

  2. 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

Related Questions