The input file holds the name of a city (as stored in the teams table).
A match is hosted in a city if the host team's city equals that value. List all such matches. For each match output four columns in this order:
match_nummatch_date formatted as YYYY-MM-DDhost_team_scoreguest_team_scoreOrder the rows by match_date ascending, then by match_num ascending.
Print one row per line, columns separated by a single space.
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