The input file holds a single publication year (an integer).
Using the book_catalogue table, for books whose year equals the input value, compute two aggregates: the total number of book titles, and the number of distinct publishers.
Output exactly one row with two columns in this order: total titles, distinct publishers.
Print the row with print(*row) (the two values separated by a single space).
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 year.txt in the same folder — A single publication year, e.g. '2015'..
primary keyforeign keyarrow points to the referenced columndrag to pan