The input file dept.txt holds a single department name (e.g. Comp. Sci.).
Write a program that reads this department name and computes the average salary of all instructors in that department, rounded to 2 decimal places.
If the department has no instructors, print 0.00.
Output: exactly one line containing a single value — the rounded average salary.
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 a department name exactly as stored in the department table..
primary keyforeign keyarrow points to the referenced columndrag to pan