The input file holds the last name of an author (e.g. Silberschatz).
Write a program that reads this author last name and lists every book in the catalogue written by an author with that last name. Join book_authors to book_catalogue.
For each matching book print, in this exact column order:
title publisher year
Output rules:
one row per line, columns separated by a single space;
order the rows by title (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 author.txt in the same folder — A single line: the author_lname to look up..
Database: LIS
primary keyforeign keyarrow points to the referenced columndrag to pan