Up Scoring goals with DevForce

Scoring goals: Create a SQL database

Last modified on May 03, 2011 12:14

My intention is to start simple, and as such, there will only be three tables in the database. They are:



Club

The Club table is a collection of the clubs in the league: 20 clubs.

  • ClubId – Primary key identifier (Int)
  • ClubName – The club’s name (String)
  • GoalsScored – The total goal scored in a season (Int)
  • GoalsAllowed – The total goals allowed or scored against the team in a season (Int)
  • TotalYellowCard – The total of yellow cards accumulated by the club in a season (Int)
  • TotalRedCard – The total of red cards accumulated by the club in a season (Int)

club.gif

Player

The Player table is a collection of all the players in the league:  about 500.

  • PlayerId – Primary key identifier (Int)
  • PlayerName – The player’s name (String)
  • PlayerPosition – The player’s position in the club (String)
  • ClubId – Foreign key identifier to the Club table indicating what club this player currently belongs to (Int)

player.gif

GameStat

The GameStat table is a collection of a player’s game statistics in a single match.

  • GameId – Primary key identifier (Int)
  • MatchOpponent – The match opponent (String)
  • Goal – The number of goals the player scored during the match (Int)
  • OwnGoal – The number of own goals the player scored during the match (Int)
  • Assist – The number of assists the player contributed during the match (Int)
  • Shots – The number of shots, either on target or off target, the player had during the match (Int)
  • ShotsOnTarget – The number of shots on target the player had during the match (Int)
  • CleanSheet – A clean sheet is when during this match, there is no goal scored against the club. This is only applicable for a Defender or a Goalkeeper. It’s 1 when it’s a clean sheet, 0 otherwise (Int)
  • NormalSave – A normal save is the number of times a Goalkeeper blocks a shot from opposing players. PKSave or a penalty kick save is not included. This is only applicable for a Goalkeeper (Int)
  • PkSave – A PkSave or a penalty kick save is the number of times a Goalkeeper blocks a shot from opposing players in a penalty kick situation. This is only applicable for a Goalkeeper (Int)
  • YellowCard – The total number of yellow cards accumulated by a player during the match. The maximum number is 2. After 2 yellow cards, 1 red card will be given and the player is out of the game (Int)
  • RedCard – The total number of red cards accumulated by a player during the match. The maximum number is 1 (Int)
  • PlayerId – Foreign key identifier to the Player table indicating which player this game statistics belongs to (Int)

gamestat.gif

Make no mistake, this design is not perfect and there are a lot of improvements that can be made, but as I have said above, my intention is to start simple. As the app grows, a lot of changes and improvements will need to be made.

-Denis

Created by DevForce on January 14, 2011 13:16

This wiki is licensed under a Creative Commons 2.0 license. XWiki Enterprise 3.2 - Documentation. Copyright © 2015 IdeaBlade