Giter VIP home page Giter VIP logo

eurosqlanalysis's Introduction

EuroSQLAnalysis

Advanced SQL Mini Project

Initial state is scripts and data dir with csv files from https://drive.google.com/file/d/1gbSU9bjpler1y5lHo6koVa5YSI1J2MRk/view?usp=sharing

  1. Running ./create_table_list.sh creates list of tables in tablenames.txt to be used in downstream scripts.
  2. Running ./build_all_tables.sh executes python script data/build_create_table_statement.py using the csv filenames to create script build_all_tables.sql.
  3. Running ./remove_col_headers.sh creates copies of csv files in data/justdata that lack column headers, which would break their import.
  4. Running ./fix_match_goals.sh cleans the corrupted goal data (1 goal - Jan, 2 - Feb, etc).
  5. Running fix_uFEFF_col_char.sh removes the unicode 'ZERO WIDTH NO-BREAK SPACE' char that precedes all of the primary key id columns, thus making querying incredibly cumbersome.
  6. Also manually edited match_mass.csv using find/replace in text editor to add extra 0's in the venue_id and referee_id columns, as they were chronically missing values and unable to left join on those ids.
  7. The file build_all_tables.sql is imported into euro_cup_2016 database within phpMyAdmin mySQL UI (creates tables based on all csv files in data dir).
  8. The csv files in data/justdata are imported into each individual table. All columns are created as varchar(N) where N is the max number of chars in each column of the table's csv file.
  9. This database is then ready to query. Image of this database was exported from phpMyAdmin to create euro_cup_2016.sql.

Solutions for each question can be found in question_solutions directory.

alt text

eurosqlanalysis's People

Contributors

conner-mcnicholas avatar

Watchers

 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.