O
O
Oleg2016-05-08 16:26:11
PostgreSQL
Oleg, 2016-05-08 16:26:11

How to design a sports competition database?

In order to get acquainted with Django (+ Django Rest Framework), I rivet a pet-project for adding and storing the results of sports competitions.
The user can create an "association" which includes "leagues" whose teams play both domestic and inter-league matches within the association. (I drew inspiration from the example of football, in particular the national leagues / UEFA Cup).
Where can I learn more about how and how not to design a database for this kind of tasks?
I am familiar with the basic principles of RMD and the concept of a normal form, but there was no design experience as such.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2016-05-08
@sim3x

You draw relationships between entities on a piece of paper, looking at Normal_shape and changing the model so that you come to 3NF
Then
https://docs.djangoproject.com/en/1.9/ref/models/f...
and
https://docs.djangoproject.com /en/1.9/topics/db/ex...

N
Neyury, 2016-06-08
@Neyury

Regarding relational DBMS, you can design like this.

  • Describe the subject area in detail
  • Write out all nouns and verbs from the subject area
  • You define among nouns what is an entity, and what are the attributes of an entity (an attribute is an atomic value)
  • You build tables (for each entity - a table) where you specify the attributes, the attributes have a data type and keys (primary and external), add the missing attributes
  • Based on entities, you build a flowchart with relationships between entities (many-to-many relationships are allowed at this stage)
  • You look at this diagram and eliminate obvious shortcomings, fix places where there is a many-to-many relationship (for example, using an associative table)
  • Congratulations, you have a database schema ready, namely entities (tables), entity attributes (columns), as well as relationships between tables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question