A city is given in the input file (the whole file content, stripped, is that city).
Find the team based in that city and list all matches it hosted (matches where it is the host team). For each such match print, in this exact order:
Join matches to teams twice — once for the host team and once for the guest team — and keep only matches whose host team's city equals the input value.
Output one row per line, columns separated by a single space, ordered by match date ascending, then match number ascending.
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 line holding a city name, e.g. Bhopal..
primary keyforeign keyarrow points to the referenced columndrag to pan