Git Product home page Git Product logo

dmarks84 / ind_project_movie-database-sqlite Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 2.74 MB

Independent Project - I joined and manipulated data from disparate tables of movie information using Python & SQLite; defined schema, created tables/views, queried data, etc. Utilized CTE's, Window Functions, and other DDL, DQL, DML, and DCL scripts.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
advanced-sql cte databases dcl ddl dml dql group-by joins python

ind_project_movie-database-sqlite's Introduction

Advanced SQL Movie Database

Screenshot

Example_TopDirectors

Summary

I utilized two datasets on movies from Kaggle, one on Netflix's shows and the other on the top 1000 movies from IMDB. I initially loaded these tables from CSV as they were received into a SQLite Database. I wrote several scripts, utilizing sqlite3 in python, to create new tables that better formatted the data (changing the datatypes) and creating primary keys. I also create other tables to contain repetitive instances of films' directors, ratings, and genres. The genre attribute represented a many-to-many relationship, so I created a linking table with to foreign keys. Most actions for querying and inserting data into the tables was accomplished with custom functions I wrote and imported/called when needed. The initial result in terms of the core data was a new, sleek table with id reference to related tables.

Using this core table, I created a number of queries and saved them as views related to meaningful questions. The questions I investigated related to the most successful directors (again, this is limited to the most successful directors whose movies made it into Netflix at the time the data was collected). I developed queries utilizing GROUP BY, CTEs, WINDOW FUNCTIONS, and other aggregate functions to answer questions like, "What is the average gross at the box office for each director as a running average/total for each successive movie they made?" or "What is the average IMDB score for each director?" The main answer I sought was to see which director, who had at least two films in the database, had the highest average gross at the box office for their films (A: Peter Jackson, as highlighted above in the screenshot of the SQLite database).

Skills (Developed & Applied)

Programming, Python, SQL, SQLite, queries, commands, DDL, DML, DCL, DQL, Window Functions, Aggregate Functions, GROUP BY, CTEs

ind_project_movie-database-sqlite's People

Contributors

dmarks84 avatar

Watchers

 avatar

Forkers

zahidsqldba

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.