Each student in students belongs to a department identified by department_code, and departments maps that code to a full department_name. Given a department name, list all students in that department.
The input file department.txt holds a single department name (exactly as stored in departments.department_name).
Output one row per student with these columns in this order, separated by a single space:
roll_nostudent_fnamestudent_lnameOrder the rows by roll_no (ascending). Print one row per line.
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 department.txt in the same folder — A single department name, e.g. "Mathematics"..
primary keyforeign keyarrow points to the referenced columndrag to pan