The input file team.txt holds the name of a team (exactly as stored in teams.name).
Across every match the team played — whether it was the host team or the guest team — add up the runs that team scored (its host_team_score in matches it hosted, its guest_team_score in matches it was the guest).
Output a single row with one column: the total runs scored by that team. If the team played no matches, print 0.
Note: Do not hard-code the database name — your program is run against a different database instance for evaluation. The input file is in the same folder as your program.
For the database connection, use these variables:
database = sys.argv[1] # database name, from the command line
user = os.environ.get('PGUSER')
password = os.environ.get('PGPASSWORD')
host = os.environ.get('PGHOST')
port = os.environ.get('PGPORT')
The input is a file named team.txt in the same folder — A single team name, e.g. Satpura..
primary keyforeign keyarrow points to the referenced columndrag to pan