SQL knowing when to split tables -


I am creating a database that tracks the replay for the game. Each replay has a different game mode that Is a team-based gameplay or personalized gameplay. Depending on the game mode, I want to record the winning team or the winning person.

I have the following MySQL table, which plays again and goals in the respective winner:

  Run the table again _Rands (Replay_ID INT Unsolved Null, Round Smallal Unsended Null, victorious_player_id INT countless, winning_tem_id tinnitated unsecured, foreign key (replay_id) reference replay (id), foreign key (replay_id, victorious_player_id) reactions to contexts (replay_id, player_id)), Ideshi key (Winning_team_id) reference teams (ID), primary key (Riple_aidi round)) character set = UTF-8 Collet = UTF 8_jijiar_ji engine = Indodibi;  

Now the experiment I have, if game mode is team-based, then I'll set winning_team_id for each round and set win_player_id to null . Similarly, if the game mode is individually-based, then I will set winning_team_id to null .

In terms of performance-wise and best practice, is this the right to leave like this? Is this a grand reason for splitting into separate tables for each game mode (even if there are only two modes)? How about a fictional situation where game mode is constantly being added - will it be the best solution by creating a table for every new game mode?

I have only one winning person (Individual winning ID drop for team and player) and game_type_cd Will be an additional feature. This will be a lookup feature that is a foreign key for a new table named GAME_TYPE_COES. Then you just need to fill the winning_ID and game type. The infinite quantity of these game types will only add data to the table of GAME_TYPE_CODE and the data structure will not be changed.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -