The input file publisher.txt contains the name of one publisher (the whole file content, stripped, is the value).
Using the book_catalogue table, consider only the titles from that publisher and compute: how many such titles are catalogued, the earliest publication year among them, and the latest publication year among them.
Output exactly one line with three values separated by single spaces, in this order:
num_titles earliest_year latest_year
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 — The name of one publisher (matches book_catalogue.publisher)..
primary keyforeign keyarrow points to the referenced columndrag to pan