SQL queries
This is a reporting tool that prints out reports (in plain text) based on the
data in the database. This reporting tool is a Python program using the
psycopg2 module to connect to the database. The tool answers the following three questions:
You will need to install the following softwares:
The data to use can be downloaded here. Unzip this file after downloading it. The file inside is called newsdata.sql
. To use load data, use the command psql -d news -f newsdata.sql
.
Run project1.py
in your terminal. You should see outputs on the terminal
which are the same as those shown in output_example.txt