The input file holds a single member class.
Join book_issue to members on member_no. Count the total number of book issue records belonging to members whose member_class equals the input value.
Output exactly one row with a single column: the total number of issues.
Print the row with print(*row).
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 member_class.txt in the same folder — A single member class, e.g. 'Undergraduate'..
primary keyforeign keyarrow points to the referenced columndrag to pan