The input file holds a department name (e.g. Comp. Sci.).
List every course taught by an instructor who belongs to that department. Join instructor to teaches to course, keeping only instructors whose dept_name equals the input value. Report each distinct (instructor, course) pair.
Output one row per distinct combination, columns space-separated in this exact order:
instructor_name course_id course_title
Order the rows by course_id, then instructor_name (both 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 input.txt in the same folder — A single department name, e.g. Comp. Sci..
primary keyforeign keyarrow points to the referenced columndrag to pan