Git Product home page Git Product logo

udacity_fsnd_sql's Introduction

Fullstack Nanodegree; Project 1; 2019

Info

The project comprises a python script and a txt-file with a sample of its output that is normally written to a log-file. The python script comprises 3 psql-queries that in turn are making use of the views listed below and a function that sends the queries to the news database and writes the results to a log-file. The file normally expects a sql-database to be in the same folder. The queries are handed to the function log_search_results in form of a dictionary with task_1, task_2, task_3 as keys and the questions to be answered as well as the queries as values. The script is run like any regular python script in the shell: python3 project_1_submission.py

Views used in psql queries

used in queries 1 & 2

CREATE VIEW freq_dist_views AS SELECT count(PATH) AS num, PATH FROM log WHERE (PATH LIKE '_article%') AND (status = '200 OK') GROUP BY PATH;

used in query 2:

CREATE VIEW authors_and_slugs AS SELECT articles.slug, authors.name FROM articles INNER JOIN authors ON articles.author = authors.id;

used in query 3

CREATE VIEW dates_and_status AS SELECT date(time) AS dates, status FROM log;

udacity_fsnd_sql's People

Contributors

ratatam123 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.