A script to analyse the database of a made-up news website.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes
README.md
log-analysis.py
newsdata.sql
sample-output.txt

README.md

Log Analysis Script

A script to analyse the database of a made-up news website.

Answers each of the following questions with a single PSQL query:

  • What are the most popular three articles of all time?
  • Who are the most popular article authors of all time?
  • On which days did more than 1% of requests lead to errors?

Requirements

  • Python 3+
  • PSQL

Setup and Usage

Run the following command to setup the database:

psql -d news -f newsdata.sql

Then:

python log-analysis.py

Relevant Technology

  • Python, PSQL, Linux