Skip to content

EllieWong/udacityClass

Repository files navigation

udacityClass

Project1 : News Website Logs Analysis Statistics

This project sets up a PostgreSQL database for a news website. The provided Python script project1.py uses the psycopg2 library to query the database and produce a report that answers the following questions:

  1. What are the most popular three articles of all time?
  • "Candidate is jerk, alleges rival" -- 338647 views
  • "Bears love berries, alleges bear" -- 253801 views
  • "Bad things gone, say good people" -- 170098 views
  1. Who are the most popular article authors of all time?
  • Ursula La Multa -- 507594 views
  • Rudolf von Treppenwitz -- 423457 views
  • Anonymous Contributor -- 170098 views
  • Markoff Chaney -- 84557 views
  1. On which days did more than 1% of requests lead to errors?
  • Jul 17,2016 -- 2.26% errors

Requirements

Usage

  1. connect the news database with the command: psql news
  2. run the command first to create a view: create view log_view as select path,count(*) as num from log group by path having path!='/' order by num desc;
  3. disconnect the database, and run the command: $python project1.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors