Jump to content

Expert database design needed :)


jmcall10

Recommended Posts

Hi,

 

Ok I am starting a project again as I think my database design was wrong from the start.

 

The project is to do with five a-aside football.

 

What I am after is to be able to store the following then refference it later on using php. For just now I am interested on how I should design the database. I.e. tables fields etc

 

 

I want to store the following and be able to make calculations on the data:

 

Players names (unlimited number of players can be stored)

Game info (i.e what 10 players played a game on a certain date and which 5 won and which 5 lost, or if it was a draw)

 

 

What I am wanting to be able to do is create a leage with this info and display the top players.

 

Once I have got a good database design I will then move on to the php section and start to create the script for that.

 

Thanks in advance

 

jmcall10

 

Link to comment
Share on other sites

Looking at the info you need to store, I'd have the following tables:

 

games

teams

players

 

The games table would have a column for the home team and a column for the away team. Also a columns for the home side score and away side score.

 

The teams table would simply have a column for the name of the team, a column for their current points/score and one for an id.

 

The players table would have players linked to their team referencing the id from the teams table.

 

When a game ends, winning players should have their score column raised by 1. If you want to award players for a draw then you may have to change the way this score works (maybe 2 for win, 1 for draw and 0 for lose).

Link to comment
Share on other sites

You are on the right track, however as it is a five asides game the teams change every week and are not fixed. So there is no need to keep track of team points as there are no official teams. I only want to track the players points depending on if they win lose or draw.

 

I hope this makes sense to someone somewhere :P

 

Thanks again :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.