1. CreateTournament(TournamentName, NumberOfTeams, StartDate, TicketPrice).
This procedure populates the tournament table with the ids of teams playing in a tournament. Each tournament is given a name (e.g. ‘Kingston Cup’). The procedure selects the teams with the highest point score to play in the tournament. (The number of teams selected to play is given by the NumberOfTeams parameter). The qualifying teams are paired up so that the team with the highest point score plays the team with the lowest point score. (E.g. if there are six teams in the tournament, #1 plays #6, #2 plays #5, and #3 plays #4.)
The procedure schedules one game per day. The first pair of teams play on the specified start date. The next pair plays the following day, etc. E.g. if the start date is Nov 1, and there are six teams in the tournament, game 1 is played on Nov 1, game 2 on Nov 2, and game 3 on Nov 3.
This procedure also sets the base ticket price for all games in the tournament.