Discover more from Data Analysis Journal
A Selection Of SQL Tutorials - Issue 163
A roundup of my favorite free SQL tutorials to get started with or advance at querying
Welcome to my Data Analytics Journal, where I write about data science and analytics.
This month, paid subscribers learned about:
How to pass a first-round interview for data science roles - tips and suggestions about navigating the interview process specifically for data science and analytics roles. Recommendations on how to stand out from other candidates.
How Strava Accelerated User Engagement - inside analytics at Strava: its process and tooling. A case study on the Route Detail page redesign that improved user activity in the app.
How To Do a Root Cause Analysis - my approach and framework for running a root cause analysis to understand unexpected user behavior change or metric decline.
Many years ago, I started making a list of my favorite go-to SQL videos, articles, and lessons I still use today. Every 6 months, I update the list to keep it relevant and add new sources. Below is my refreshed list of mostly free SQL tutorials and practice sites.
I had to learn SQL at school, but many successful analysts I know are self-taught SQL coders.
Personally, I wouldn’t recommend enrolling in bootcamps or expensive programs to learn SQL. Go through the publications and videos below, and I guarantee you will be comfortable within a few months. It’s all about practice.
🛴 Getting started
A beginner's guide to SQL - a little old, but still one of the best introductions I’ve seen.
SQL LEFT JOIN – A Beginner’s Guide - a really good read from one of the engineering champions Vlad Mihalcea. I was a fan of his writing before he journeyed from data to Java. His evergreen LEFT JOIN guide still stays my favorite
Using ON Versus WHERE Clauses to Combine and Filter Data in PostgreSQL Joins - this is one of the common interview questions for analysts.
Learn Database Design with SQL Server - walks you through how to install a database, its terminology, fundamental concepts, usage, etc. Their walkthrough can be applied to other SQL variations besides SQL Server. If you are a MySQL user, here is a similar one - a MySQL tutorial.
One and only A SQL Style Guide.
🚲 Become proficient
SQL Best Practices - How to type code cleanly and perfectly organized
Top 5 SQL Analytic Functions Every Data Analyst Needs to Know
Bucketing in SQL - grouping, bucketing, and segmenting users, dates, and events in SQL, from simple to complex cases.
SQL Workshop: SQL Patterns Every Analyst Should Know with
from (so you know it is good).Reasons why SELECT * is bad for SQL performance - this article is more targeted toward DE, but the second part explains some good query plan optimization methods.
🧪 SQL for A/B Testing:
Experimentation Platform in a Day - the first part of the article walks through the experimentation service setup, but the second has good handy SQL you can borrow to read the test.
How To Develop a Highly Trusted Experiment Analysis Workflow - where
from shares SQL for calculating metrics, experiment windows, excluding bias, etc.
🚀 Advance and become an expert
How to Parse Strings Like a Pro Using SQL SUBSTRING() Function?
The Best SQL Template for Customer Lifetime Value - you’re welcome.
SQL for getting cohorted user retention by yours truly published in
.Advanced SQL - Common Table Expressions - amazing piece on CTEs
Hierarchical Structures in PostgreSQL - aimed more for DE.
And some of my favorite publications from one and only Haki Benita ⭐:
How to Get the First or Last Value in a Group Using Group By in SQL
12 Common Mistakes and Missed Optimization Opportunities in SQL
Some of my SQL publications (available for paid subscribers):
🔨 Practicing SQL on your own
The best way to practice SQL is in your local database. For this, you can install the PostgreSQL database and use the DataGrip client with it. This gives you the flexibility to design the schema the way you want and practice SQL from anywhere at any time.
If you want to go a simpler route, use SQLFiddle or DB-Feddle tools. You can either paste your SQL there and polish the syntax or design your own table schema.
You can also try Simplql - an in-browser tool that lets you query data files with SQL without using a database. It does everything in the browser. Users can export the results from their queries in CSV or JSON. Easy, fast, and intuitive.
🎓 Free SQL tutorials and courses
If you are a beginner looking for a quick tutorial on basics, check out SQL Zoo.
The SQL Tutorial for Data Analysis - this is from Mode. The descriptions are spot on and the structure is good. They also have another - The Intermediate SQL Tutorial, which focuses more on functions and joins.
SQLCourse2.com - an online interactive SQL tutorial, from basics to advanced topics. Very similar to W3 school SQL. Both are good if you are new to SQL.
TutorialRepublic - SQL Tutorial - I like this tutorial more, as it contains more specific examples, making it easier to understand.
Leetcode - SQL - a set of SQL problems and challenges by topic, from simple to difficult. I bet we all spent a good deal of hours there. A good source to test yourself.
WindowFunctions and PG Casts - more on an advanced side for SQL users. Postgres specific.
Another new SQL Window Functions tutorial - everything you have to know about window functions. A detailed guide with examples and nice visuals.
⁉️ Interview preparation
I continually update this list to keep it fresh and relevant, so please send me your favorite SQL links and sources that you think I should add!
Thanks for reading, everyone. Until next Wednesday!
Subscribe to Data Analysis Journal
Where product, data science, and analytics intersect. Trusted by tens of thousands of data scientists around the world
Thanks for pulling together all of these resources!
thank you!