Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6999845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:35:40+00:00 2026-05-27T20:35:40+00:00

I have the need to create a database for some data I have, and

  • 0

I have the need to create a database for some data I have, and so I took a crack at it (as you would hope), and now I need help putting the finishing touches on it! Can you help me normalize this?

I took a picture of the design I created in Excel using fake data:

enter image description here

What you should know is that some games will be played 5v5 and some will be played 3v3. Instead of adding columns for Team1P1, Team1P2, Team1P3, etc., I wanted to leave it up to the experts to help me do this.

Question: Based on my file parser, my application will know whether a game has 6 players (3v3) or 10 (5v5). How can I structure the database to map those players back to the game? Instead of trying to put Player data into the Games table, should I add a column in Players which points to the Game ID ?

Players:
id | player_id | game_id | etc…

Edit for clarification

Picture Starcraft 2, or any other RTS game played online. When a game starts, it is a brand new slate. A set number of players join a match (3v3 or 5v5) and play against each other. At the end of the game, everyone has certain stat values (did they win or lose? How much gold did they have? How many kills, deaths, assists did they have?)

Each of these stats is specific to that player in that game.

If I play 2 games that day, I will look like this:

id | player_id | stat1 | stat2 | stat3 |
1 | 100 | 500 | 600 | 700
2 | 100 | 300 | 999 | 2000

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:35:41+00:00Added an answer on May 27, 2026 at 8:35 pm

    I mostly agree with PeeHaa’s answer, though I have a couple of changes. First, I agree that the id fields in both the tables you propose, pr0tocol, are confusing since you also have game_id and player_id fields. Just use those.

    I also agree that you should have a separate game_players table that consists solely of game_id and player_id and both of those fields combined are the primary key of the table.

    I feel your stats table should be keyed the same as the game_players table. This way, not only are you keeping track of each individual player’s stats, but you also have the ability to report statistics for individual games.

    Edit:

    Games:

      key
    game_id  |  game_length  |  game_mode  |  game_type  |  ranked
    

    Players:

       key
    player_id  |  other player data - no stats in here
    

    Game_Players

      key    |     key
    game_id  |  player_id
    

    Stats

      key    |     key
    game_id  |  player_id  |  stat1  |  stat2  |  stat3  |  etc...
    

    Using these four tables, you can keep track of all stats and be able to separate them based by player or game through whatever reports you choose to write. It doesn’t matter now how many games an individual player is assigned to, since it’s only part of the key in the relevant tables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a Firebird Database programmatically using DBExpress. I have done this
I have a database in ISO-8859-2 format, but I need to create XML in
I have basically MySQL dump from a WordPress database with some data. The whole
Building a relatively simple website, and need to store some data in the database
I have inherited a very old database that needs some data to be updated.
I need to create a storage file format for some simple data in a
I need to create database (+schema, data, procedures, roles) using procedure/function - when I
I have a need to create a transactional process using an external API that
I have the need to create the functionality to allow my registered users to
We have a need to create a private key that is seeded from 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.