The library keeps a catalogue of books in book_catalogue. Given the name of a publisher, list every catalogued book published by that publisher.
The input file publisher.txt holds a single publisher name (exactly as stored in book_catalogue.publisher).
Output one row per book with these columns in this order, separated by a single space:
titleyearOrder the rows by year (ascending), then by title (ascending), then by ISBN_no (ascending) to break ties. 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 publisher.txt in the same folder — A single publisher name, e.g. "McGraw Hill"..
primary keyforeign keyarrow points to the referenced columndrag to pan