This procedure is designed to add a specified dollar prize to the total winnings of a given team.
teamID (int): The ID of the team to which the prize will be added. dollarPrize (int): The amount of the prize in dollars.
CALL addPrizeForTeam(teamID, dollarPrize);This function retrieves the start date of a player based on their nickname.
nn (text): The nickname of the player.
date: The start date of the player.
SELECT startDateByNickname('player_nickname');This trigger function is designed to automatically update the total winnings of a team when a new prize is added.
This trigger function is invoked automatically when a new record is inserted into a table that it is associated with.
This function retrieves the names of teams associated with a specified game.
gameName (text): The name of the game.
TABLE (_name TEXT): A table containing the names of teams.
SELECT * FROM getTeamNames('game_name');This function retrieves the players' information for a specified team and game.
TEAM_NAME (TEXT): The name of the team. GAME (TEXT): The name of the game.
TEXT[][]: An array containing arrays of player information.
SELECT * FROM getTeamPlayers('team_name', 'game_name');This function retrieves the total approximate winnings of a specified team.
TEAM_NAME (TEXT): The name of the team.
INTEGER: The total approximate winnings of the team.
SELECT getTeamAproxWin('team_name');getPlayerAge Function
This function retrieves the age of a player based on their first name.
PLAYER_FIRST_NAME (TEXT): The first name of the player.
interval: The age of the player.
SELECT getPlayerAge('player_first_name');This function retrieves the country of a player based on various identifiers.
player_identifier (TEXT): The player's nickname, first name, or second name.
TEXT: The country of the player.
SELECT getPlayerCountry('player_identifier');This function retrieves the names of teams associated with a player based on their nickname, first name, or second name.
player_identifier (TEXT): The player's nickname, first name, or second name.
SETOF TEXT: A set of team names.
sql
SELECT * FROM getPlayerTeam('player_identifier');
This function retrieves information about the staff associated with a specified team.
team_name (TEXT): The name of the team.
TEXT[]: An array containing arrays of staff information.
SELECT * FROM getTeamStuff('team_name');This function retrieves the salary associated with a specified job.
job_desc (TEXT): The description of the job.
TEXT: The salary of the job.
SELECT getJobSalary('job_description');This function retrieves the names of tournaments associated with a specified game.
game (TEXT): The name of the game.
TEXT[]: An array containing tournament names.
SELECT * FROM getTournamentsByGames('game_name');This function retrieves the names of teams participating in a specified tournament.
tournament_name (TEXT): The name of the tournament.
TEXT[]: An array containing team names.
SELECT * FROM getTeamsOnTournament('tournament_name');This procedure is designed to delete a player based on their nickname.
player_nick (TEXT): The nickname of the player.
CALL deletePlayer('player_nickname');This procedure is designed to add a new player with the specified details.
nick_name (TEXT): The nickname of the player. first_name_pl (TEXT): The first name of the player. second_name_pl (TEXT): The second name of the player. birthday_date_pl (TEXT): The birthday of the player. total_win (INTEGER): The total winnings of the player. team_name (TEXT): The name of the team to which the player belongs. player_country (TEXT): The country of the player.
CALL addPlayer('nick_name', 'first_name', 'second_name', 'birthday_date', total_win, 'team_name', 'player_country');This function retrieves the names of tournaments associated with a specified team.
team_name (TEXT): The name of the team.
TEXT[]: An array containing tournament names.
SELECT * FROM getTournamentsOfATeam('team_name');This procedure is designed to associate a team with a specified tournament.
tm_name (TEXT): The name of the tournament. team_name (TEXT): The name of the team.
CALL addTournamentToATeam('tournament_name', 'team_name');This procedure is designed to add a new tournament with the specified details.
tour_name (TEXT): The name of the tournament. tour_prize_pool (INT): The prize pool of the tournament. game_name (TEXT): The name of the game associated with the tournament. country_name (TEXT): The country where the tournament takes place. winner_team_name (TEXT): The name of the winning team.
CALL addTournament('tournament_name', tour_prize_pool, 'game_name', 'country_name', 'winner_team_name');This procedure is designed to add a new organization with the specified details.
org_name (TEXT): The name of the organization. org_desc (TEXT): The description of the organization.
CALL addOrg('organization_name', 'organization_description');This procedure is designed to add a new game with the specified details.
game_name (TEXT): The name of the game. org_desc (TEXT): The description of the game.
CALL addGame('game_name', 'game_description');This procedure is designed to add a new team with the specified details.
org_name (TEXT): The name of the organization to which the team belongs. game_name (TEXT): The name of the game associated with the team. _total_win (INTEGER): The total winnings of the team. region_name (TEXT): The name of the region associated with the team.
CALL addTeam('organization_name', 'game_name', _total_win, 'region_name');This procedure is designed to remove an organization based on its name.
org_name (TEXT): The name of the organization to be removed.
CALL remOrg('organization_name');This procedure is designed to set the winner of a specified tournament.
tour_name (TEXT): The name of the tournament. winner_name (TEXT): The name of the winning organization.
CALL setTourWinner('tournament_name', 'winner_organization_name');This function retrieves information about a specified tournament.
_tour_name (TEXT): The name of the tournament.
TABLE (tour_name TEXT, prize_pool INTEGER, game_name TEXT, country_name TEXT, winner_name TEXT): Information about the tournament.
SELECT * FROM getTourInfo('tournament_name');This function retrieves information about all players.
TEXT[]: An array containing information about all players.
SELECT * FROM getAllPlayers();