Its a reporting tool that will use information from the database to discover what kind of articles the site's readers like in a newspaper website.
1. popular_three_articles(). Results are the most popular three articles of all time.
2. popular_authors(). Results are the most popular article authors of all time.
3. more_than_one_percent(). Results days in which more than 1% of requests lead to errors
Python 2.7
psql (PostgreSQL) 9.5.16
vagrant 2.2.4
For this you will need Vagrant and VirtualBox software installed on your system. You can find:
Vagrant from here
VirtualBox from here
newsdatadb.py
The Python program that connects to the PostgreSQL database, executes the SQL queries and displays the results.
output.txt
README.md
After installing VirtualBox and Vagrant you will need to use GitBash or command prompt for windows, terminal screen in Linux, browse to the project directory.
From your terminal, run the command:
It should take awhile for the first time in order to download the vm image. Then you can log into the VM by using this following command:
You can download the database from here
You will need to unzip this file after downloading it. The file inside is called newsdata.sql. Put this file into the vagrant directory, which is shared with your virtual machine.
cd into the vagrant directory and use the command
This command will connect to the database server and exeute query which will create the tables for the database and populate them with data.
You can run the reporting tool using this command
press Ctrl-D, then shut down use this command "vagrant halt"