The input file holds a member class (one of Administrative, Doctoral, Professor, Technical, Undergraduate).
Write a program that reads this member class and lists every book issued to members of that class. Join members to its borrowing quota and to the book_issue records so that each issued book is reported alongside the member's book-limit.
For each issued book print, in this exact column order:
member_no max_books doi
where doi is the date of issue formatted as YYYY-MM-DD.
Output rules:
member_no (ascending), then by doi (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 member_class.txt in the same folder — A single line: the member_class to look up..
primary keyforeign keyarrow points to the referenced columndrag to pan