The input file holds a single department name (exactly as stored in the database, e.g. Comp. Sci.).
Write a program that lists every instructor belonging to that department.
For each matching instructor, output three columns in this order:
IDnamesalaryOrder the rows by salary in descending order; break ties by ID in ascending order.
Print one row per line, columns separated by a single space. If no instructor matches, print nothing.
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 dept.txt in the same folder — A single line containing one department name exactly as stored (e.g. Comp. Sci.)..
primary keyforeign keyarrow points to the referenced columndrag to pan