Every library member in members has a member_class and a member_type; the quota table gives the borrowing limits for each member_type. Given a member class, list all members of that class together with the maximum number of books their type may borrow.
The input file member_class.txt holds a single member class (exactly as stored in members.member_class).
Output one row per member with these columns in this order, separated by a single space:
member_nomember_typemax_booksOrder the rows by member_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 member_class.txt in the same folder — A single member class, e.g. "Undergraduate"..
primary keyforeign keyarrow points to the referenced columndrag to pan