Wednesday, 15 July 2015

database - DB Architecture : Linking to intersection or to main tables? -


I am creating a fantasy football system on my website, but I am very confused about how to give me some table I should add

Tables

The main table is pool , which contains all information about the decision of the fantasy drafting.

A standard table user , which contains general content. Paste table named

pools_users in which id, pool_id, user_id because one user can be in more than one pool, and more than 1 in a pool There are users.

Problem

Table Selection => This is the table that is causing the problem. It is a choice that the user To choose. It is related to player but is not relevant to this problem.

Should I link this table to Pool Pool_UJs or I should link it to the main table pool and user. In this table, id, pool_id, user_id, player_id, ...

What is the best way to link my tables? When I want to recover my data, I usually want to divide information by users. "This user has those selections, those selections, etc.).

What is a pool? This is a league, which is a group of teams competing against each other? The reason I ask, it seems that you have a unit, which has intelligence, Team ** (*) ** .

To some extent this decision depends on the rules of the fashion football game you are running, but in my experience, most game users Allows the coworkers to take part in many leagues (? Pool?), But to manage only one team. For a relationship between the users and the teams. Once we see it in this way, it is clear It is possible that there should be an intersection table between the election teams (users) and the players.

If a particular set of rules is set to a user, then you should merge two entities in a table. A - which I choose to call managers, because it fits better to the domain, but your decision is yours;).


No comments:

Post a Comment