A person uses a ruler to measure a plank of light-colored wood.
9 min readSQL for Python Developers

Creating Tables: DDL for Python Devs

Map Python types to SQL types. Learn CREATE TABLE with primary keys, foreign keys, and constraints like NOT NULL and DEFAULT.

Deep-sky image showing a dense concentration of bright stars against a black background.
9 min readSQL for Python Developers

NULL: The Value That Isn't

NULL means unknown, not empty. Why NULL = NULL isn't true, three-valued logic, and how NULL behaves in WHERE, GROUP BY, JOINs and subqueries.

A row of bright yellow, stylized rubber ducks arranged horizontally against a solid turquoise background.
5 min readSQL for Python Developers

CTEs: Making Your SQL Readable

WITH clauses let you name your subqueries and read top-to-bottom instead of inside-out. Transform nested spaghetti into clean steps.

A row of colorful ceramic trinket figurines depicting stylized, cheerful female faces.
6 min readSQL for Python Developers

Subqueries: When SQL Needs Helper Functions

Nest queries inside queries, like Python helper functions. Use them in WHERE, SELECT, or FROM to compute intermediate results.

Group of people standing on a pier overlooking the sea, with a large Ferris wheel structure visible in the background.
9 min readSQL for Python Developers

JOINs Explained for Python Developers

Connect related tables like looking up values in a Python dictionary. Covers INNER JOIN, LEFT JOIN, and when to use each.

A heavily congested urban street scene showing dense traffic among buildings in a major city center.
3 min readSQL for Python Developers

HAVING: Filtering Grouped Results

WHERE filters rows before grouping; HAVING filters after. Need "only cities with more than 10 customers"? That's HAVING.

Vibrant market stall overflowing with brightly colored piles of fresh fruits and vegetables, including apples, tomatoes, and mangoes.
5 min readSQL for Python Developers

GROUP BY: Aggregating Your Data

GROUP BY creates buckets and counts them. It's like Python's `collections.Counter` or pandas `groupby()`. Learn COUNT, SUM, AVG, MIN, and MAX.

Pour-over coffee dripper filled with grounds rests on a slatted wooden surface.
5 min readSQL for Python Developers

WHERE: Filtering Your Data

Filter rows with conditions, the SQL equivalent of list comprehension `if` clauses. Covers AND/OR, IN, BETWEEN, LIKE patterns, and NULL handling.