Database Design and normalization in chess

Beginner

I was wondering what was the better approach for my database/table design. As show in the picture, i have players who play a match. One player plays multiple matches and one match is played by multiple players, so it is a n:m relation. This could result in thress tables player(id, firstname), player_to_match(playerid, matchid), match(id). In my case, the number of players never changes, it is always two (n=2). Which of the following designs is better?

(1)

player_to_match(matchid, playerid)

Having two rows for each map and one cell redundancy (matchid)

(2)

match(matchid, playerid1, playerid2)

As i said, the number of players per match can never change

Thank you

Lucas

[ERM-Diagram with two Entities: Player(ID, Firstname), Match(ID), n:m Assosiation from Player to Match titled "plays"] http://fs1.directupload.net/images/141210/rmeuutpg.png

Joe Stefanelli

I'd stick with option (1). It will make it easier to answer such simple questions as "how many matches has player X played?" With option (2), you'd have to query two columns for the value X to answer that question and that starts to get ugly.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Chess game design and Singleton pattern

From Dev

When creating models in Django, should database normalization be taken into consideration?

From Dev

Refactor C# chess game to follow MVC design pattern

From Dev

Database normalization of tables with only id and Description

From Dev

OOP Design for Chess Game in Java (Trouble with Piece / Board Interaction)

From Dev

What are Database Normalization and Functional Dependencies?

From Dev

User database schema - over normalization or not?

From Dev

SQL Query from database schema with functional dependences. Normalization

From Dev

How to do database normalization with long string?

From Dev

How to manage cross referencing in Object Oriented design ? (chess example)

From Dev

Database normalization for shoes online shop

From Dev

How to store an array in a database whilst sticking to normalization?

From Dev

Database Normalization scenario

From Dev

When creating models in Django, should database normalization be taken into consideration?

From Dev

What kind of normalization is used here in database structure?

From Dev

a few questions from database normalization

From Dev

normalization of database structure

From Dev

Database Normalization Exercise

From Dev

Database Normalization Validation

From Dev

Normalization of a database

From Dev

Database Table Normalization

From Dev

database normalization do I need it

From Dev

Do we always start database normalization from 0-NF?

From Dev

Database Normalization - Field depending on another non-key field

From Dev

My database design for movie database

From Dev

Symfony doctrine database normalization

From Dev

MySQL Database Normalization .. one table to connect multiple others?

From Dev

Database design for simple money transfers and normalization

From Dev

Database Normalization mistake

Related Related

  1. 1

    Chess game design and Singleton pattern

  2. 2

    When creating models in Django, should database normalization be taken into consideration?

  3. 3

    Refactor C# chess game to follow MVC design pattern

  4. 4

    Database normalization of tables with only id and Description

  5. 5

    OOP Design for Chess Game in Java (Trouble with Piece / Board Interaction)

  6. 6

    What are Database Normalization and Functional Dependencies?

  7. 7

    User database schema - over normalization or not?

  8. 8

    SQL Query from database schema with functional dependences. Normalization

  9. 9

    How to do database normalization with long string?

  10. 10

    How to manage cross referencing in Object Oriented design ? (chess example)

  11. 11

    Database normalization for shoes online shop

  12. 12

    How to store an array in a database whilst sticking to normalization?

  13. 13

    Database Normalization scenario

  14. 14

    When creating models in Django, should database normalization be taken into consideration?

  15. 15

    What kind of normalization is used here in database structure?

  16. 16

    a few questions from database normalization

  17. 17

    normalization of database structure

  18. 18

    Database Normalization Exercise

  19. 19

    Database Normalization Validation

  20. 20

    Normalization of a database

  21. 21

    Database Table Normalization

  22. 22

    database normalization do I need it

  23. 23

    Do we always start database normalization from 0-NF?

  24. 24

    Database Normalization - Field depending on another non-key field

  25. 25

    My database design for movie database

  26. 26

    Symfony doctrine database normalization

  27. 27

    MySQL Database Normalization .. one table to connect multiple others?

  28. 28

    Database design for simple money transfers and normalization

  29. 29

    Database Normalization mistake

HotTag

Archive