PostgreSQL for
Data Analytics
Danny Ma
June 2024
About me
My Data Analytics Journey
Data Analyst Customer Loyalty
Marketing Cloud ML & Data Data Consultant
Campaigns Engineering Educator & Mentor
SQL, Excel, SAS SQL, Python, Scala SQL, Python
2010 2014 2016 2018 2020 PRESENT
Started Bachelors Digital Banking Launched
Actuarial Studies & Data Science & ML Data With Danny
Economics Experimentation Online Community
Excel, Matlab, R SQL, R, Python SQL, Python
05
How can I find
out more about
Data With Danny?
bit.ly/dwd-info
SQL FACTS
SQL queries can be used The modern data stack is
SQL appears in over 40% with many languages moving to SQL-centric tools
of all data job listings and frameworks via such as dbt, Snowflake,
posted on Indeed in 2021 objects and APIs to Amazon Redshift and
interact with databases Google BigQuery
SQL is a standardised SQL databases can store
65% of data analysts
language making it a semi-structured data like
and data scientists use
very versatile skill used JSON objects with
SQL according to a 2020
across different domains expanding support for maps,
Stack Overflow survey
and tech environments images, video and audio
THE PLAN FOR TODAY
SQL General
Simplified Q&A
CRYPTO CASE STUDY
SQL SIMPLIFIED
Session 1 Session 2 Session 3 Session 4
Case Study Group By & Window Multiple
Introduction Case When Functions Table Joins
SQL SIMPLIFIED
Session 1
Case Study
Introduction
SELECT STATEMENT
LIMIT
ORDER BY
COUNT
WHERE FILTERS
DISTINCT
DISTINCT
SQL SIMPLIFIED
Session 1 Session 2
Case Study Group By &
Introduction Case When
BETWEEN
INEQUALITIES
AGGREGATE FUNCTIONS
EXTRACT DATE INFO
DATE TRUNCATION
CAST DATA TYPES
MULTI-LEVEL SORTING
SQL SIMPLIFIED
Session 1 Session 2
Case Study Group By &
Introduction Case When
BASIC CASE WHEN
SUM CASE WHEN: COUNTIF
SUM CASE WHEN: SUMIF
LEFT/RIGHT STRINGS
CHARACTER LENGTH
REMOVE LAST CHARACTER
SQL SIMPLIFIED
Session 1 Session 2 Session 3
Case Study Group By & Window
Introduction Case When Functions
RANK WINDOW FUNCTION
7 DAY MOVING AVERAGE
CUMULATIVE SUM
LAG WINDOW FUNCTION
SQL SIMPLIFIED
Session 1 Session 2 Session 3 Session 4
Case Study Group By & Window Multiple
Introduction Case When Functions Table Joins
INNER JOIN
LEFT JOIN
MULTIPLE TABLE JOINS
SQL SIMPLIFIED COMPLETED!
Session 1 Session 2 Session 3 Session 4
Case Study Group By & Window Multiple
Introduction Case When Functions Table Joins
05
General Q&A bit.ly/dwd-info