Git Product home page Git Product logo

doyouknowthedom2's Introduction

PairColumbus Personal Repo

Challenges from PairColumbus

Each folder present focus section (SQL, DataAnalytics, Testing, Algorithm, Ruby, Python)

Workflow for SQL:

  • Database of choice: PostgreSQL (tutorials) and/or SQLite. SQLite has minimal support for RE hence PostgreSQL is recommended.

  • Pandas for importing, pre-processing -> using SQLAlchemy to [update/create] [tables]. The rationale is to save tedious URL parsing (.csv files not well-supported in PostgreSQL, you have to manually CREATE TABLE / DROP TABLE IF EXISTS and feed columns and column data type into psql) and to automate works.

  • CLI: =#psql for monitoring databases and ipython for running scripts.

  • Editor of choice for SQL queries: Sublime Text with SQLTools plugin. On MacOS, you should install the sublime package FixMacPath to address the path issue when connecting to [PostgreSQL] databases

createdb [dbname] #PostgreSQL cli to create database
cd [sql directory]

Open python (Ipython, Jupyter) to run helper scripts

from utils import *
create_table_from_csv('filmdeathcounts')
jeopardy() # built-in loadder for jeopardy dataset
talkpay() # built-in
fy16_school() # built-in
marvel() # built-in

Tables filmdeathcounts, jeopardy, talkpay, marvel-wikia-data, fy16_school.* and others should now be ready for queries

Learning

Tool What
SQL Different flavors (MySQL, PostgreSQL, SQLite, SQL Server) have very different supports and syntaxes for eg. regex, comparison, data types, etc. which make ORM tools like SQLAlchemy the more compelling.
SQL Relative popularity according to Google Trends
SQL Server 70
MySQL 50
PostgreSQL 20
SQLite 8
PostgreSQL Open Source, ANSI-standard, stability, scalibility.
PostgreSQL Newline / Linebreak: chr(10)
PostgreSQL Column names should be taken seriously. "Spaces, non-word characters like $ % etc." all make selections very cubersome. I wrote a rename_to_conform_postgre routine to standardize column names (remove all non-word characters and lower case) when using PostgreSQL
PostgreSQL Regular expression: regexp_matches() for SELECT or ~ for WHERE
PostgreSQL Remove curly braces (result from regexp_matches, for ex.): unnest(text)
PostgreSQL regexp_matches(text, pattern, 'g') with g flag might return multiple rows, don't put another regexp_matches in the same SELECT, use JOIN instead
PostgreSQL Single '' and double "" quotes mean differently: ie. 'string_values' whislt "table/column_names", more on this

Extra Credits

#trump Trump is not a person's name. It is the name of an Empire with hundreds of states (companies).

#paytalk It pays really well in the Tech industry, quite encouraging.

#marvel The number of Marvel characters is simply marvelous. More than 16 thousands (What!).

doyouknowthedom2's People

Contributors

jaybobo avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.