The input file city.txt holds the name of a city (exactly as stored in teams.city). Exactly one team is based in that city.
Count the number of matches that team won. A team wins a match when it scored strictly more runs than its opponent — this applies whether it was the host team (its host_team_score beat the guest_team_score) or the guest team (its guest_team_score beat the host_team_score).
Output a single row with one column: the number of wins for the team from that city. If the team never won, 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 city.txt in the same folder — A single city name, e.g. Bhopal..
primary keyforeign keyarrow points to the referenced columndrag to pan