<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>SQL for Python Developers on Jamal Hansen</title><link>https://jamalhansen.com/series/sql-for-python-developers/</link><description>Recent content in SQL for Python Developers on Jamal Hansen</description><image><title>Jamal Hansen</title><url>https://jamalhansen.com/author.png</url><link>https://jamalhansen.com/author.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 01 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://jamalhansen.com/series/sql-for-python-developers/index.xml" rel="self" type="application/rss+xml"/><item><title>ORM vs Raw SQL: Decision Framework</title><link>https://jamalhansen.com/blog/orm-vs-raw-sql-decision-framework/</link><pubDate>Mon, 01 Jun 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/orm-vs-raw-sql-decision-framework/</guid><description>It&amp;#39;s not either/or. Use ORMs for CRUD and migrations; use raw SQL for analytics and complex queries. A practical decision guide.</description></item><item><title>Parameterized Queries &amp; Security</title><link>https://jamalhansen.com/blog/parameterized-queries-and-security/</link><pubDate>Mon, 25 May 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/parameterized-queries-and-security/</guid><description>String formatting in SQL is dangerous. Learn parameterized queries to keep user input safe and prevent SQL injection attacks.</description></item><item><title>Python + DuckDB: Real ETL Patterns</title><link>https://jamalhansen.com/blog/python-duckdb-real-etl-patterns/</link><pubDate>Mon, 18 May 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/python-duckdb-real-etl-patterns/</guid><description>Build a complete pipeline - fetch from an API, load into DuckDB, transform with SQL, export results. A capstone putting it all together.</description></item><item><title>Optimizing Queries: EXPLAIN for Python Developers</title><link>https://jamalhansen.com/blog/optimizing-queries-explain-for-python-developers/</link><pubDate>Mon, 11 May 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/optimizing-queries-explain-for-python-developers/</guid><description>Read EXPLAIN output to understand why queries are slow. Learn when to add indexes and when to stop worrying about performance.</description></item><item><title>Modifying Data Safely</title><link>https://jamalhansen.com/blog/modifying-data-safely/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/modifying-data-safely/</guid><description>INSERT, UPDATE, and DELETE with guardrails. Always use WHERE, test with SELECT first, and use transactions to undo mistakes.</description></item><item><title>Creating Tables: DDL for Python Devs</title><link>https://jamalhansen.com/blog/creating-tables-ddl-for-python-devs/</link><pubDate>Mon, 27 Apr 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/creating-tables-ddl-for-python-devs/</guid><description>Map Python types to SQL types. Learn CREATE TABLE with primary keys, foreign keys, and constraints like NOT NULL and DEFAULT.</description></item><item><title>Window Functions: The Feature Python Developers Miss Most</title><link>https://jamalhansen.com/blog/window-functions-the-feature-python-developers-miss-most/</link><pubDate>Mon, 20 Apr 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/window-functions-the-feature-python-developers-miss-most/</guid><description>Calculate across rows without collapsing them. Running totals, rankings, and row comparisons that GROUP BY can&amp;#39;t do.</description></item><item><title>NULL: The Value That Isn't</title><link>https://jamalhansen.com/blog/null-the-value-that-isnt/</link><pubDate>Mon, 13 Apr 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/null-the-value-that-isnt/</guid><description>NULL means &amp;#34;unknown,&amp;#34; not &amp;#34;empty.&amp;#34; Why NULL = NULL isn&amp;#39;t true, three-valued logic, and how NULL behaves in WHERE, GROUP BY, JOINs, and subqueries. Master COALESCE and NULLIF.</description></item><item><title>CTEs: Making Your SQL Readable</title><link>https://jamalhansen.com/blog/ctes-making-your-sql-readable/</link><pubDate>Mon, 06 Apr 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/ctes-making-your-sql-readable/</guid><description>WITH clauses let you name your subqueries and read top-to-bottom instead of inside-out. Transform nested spaghetti into clean steps.</description></item><item><title>Subqueries: When SQL Needs Helper Functions</title><link>https://jamalhansen.com/blog/subqueries-when-sql-needs-helper-functions/</link><pubDate>Mon, 30 Mar 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/subqueries-when-sql-needs-helper-functions/</guid><description>Nest queries inside queries, like Python helper functions. Use them in WHERE, SELECT, or FROM to compute intermediate results.</description></item><item><title>JOINs Explained for Python Developers</title><link>https://jamalhansen.com/blog/joins-explained-for-python-developers/</link><pubDate>Mon, 23 Mar 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/joins-explained-for-python-developers/</guid><description>Connect related tables like looking up values in a Python dictionary. Covers INNER JOIN, LEFT JOIN, and when to use each.</description></item><item><title>HAVING: Filtering Grouped Results</title><link>https://jamalhansen.com/blog/having-filtering-grouped-results/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/having-filtering-grouped-results/</guid><description>WHERE filters rows before grouping; HAVING filters after. Need &amp;#34;only cities with more than 10 customers&amp;#34;? That&amp;#39;s HAVING.</description></item><item><title>GROUP BY: Aggregating Your Data</title><link>https://jamalhansen.com/blog/group-by-aggregating-your-data/</link><pubDate>Mon, 09 Mar 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/group-by-aggregating-your-data/</guid><description>GROUP BY creates buckets and counts them. It&amp;#39;s like Python&amp;#39;s `collections.Counter` or pandas `groupby()`. Learn COUNT, SUM, AVG, MIN, and MAX.</description></item><item><title>WHERE: Filtering Your Data</title><link>https://jamalhansen.com/blog/where-filtering-your-data/</link><pubDate>Mon, 02 Mar 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/where-filtering-your-data/</guid><description>Filter rows with conditions, the SQL equivalent of list comprehension `if` clauses. Covers AND/OR, IN, BETWEEN, LIKE patterns, and NULL handling.</description></item><item><title>ORDER BY: Sorting Your Results</title><link>https://jamalhansen.com/blog/order-by-sorting-your-results/</link><pubDate>Mon, 23 Feb 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/order-by-sorting-your-results/</guid><description>SQL returns rows in no guaranteed order. Run the same query twice and you might get different results. ORDER BY gives you control, like Python&amp;#39;s sorted() with key functions.</description></item><item><title>SELECT: Choosing Your Columns</title><link>https://jamalhansen.com/blog/select-choosing-your-columns/</link><pubDate>Mon, 16 Feb 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/select-choosing-your-columns/</guid><description>SQL&amp;#39;s SELECT is more than picking columns. Rename with AS, compute expressions, and use DISTINCT for unique values.</description></item><item><title>FROM: Where Your Data Lives</title><link>https://jamalhansen.com/blog/from-where-your-data-lives/</link><pubDate>Mon, 09 Feb 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/from-where-your-data-lives/</guid><description>We write SELECT first, but FROM executes first. It&amp;#39;s like the `for item in collection` part of a Python loop. You pick your data source before doing anything else.</description></item><item><title>SQL Thinks in Sets, Not Loops</title><link>https://jamalhansen.com/blog/sql-thinks-in-sets-not-loops/</link><pubDate>Mon, 02 Feb 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/sql-thinks-in-sets-not-loops/</guid><description>The mental model shift that makes SQL click: SQL is declarative (describe what you want) rather than procedural (step-by-step loops). Once you think in sets instead of rows, the keywords become intuitive.</description></item><item><title>Don't forget to save! Persisting your DuckDB database</title><link>https://jamalhansen.com/blog/dont-forget-to-save-persisting-your-duckdb-database/</link><pubDate>Mon, 26 Jan 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/dont-forget-to-save-persisting-your-duckdb-database/</guid><description>Your in-memory database disappears when Python exits. Let&amp;#39;s fix that with a one-line change that saves everything to disk.</description></item><item><title>Generate Practice Data with faker</title><link>https://jamalhansen.com/blog/generate-practice-data-with-faker/</link><pubDate>Mon, 19 Jan 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/generate-practice-data-with-faker/</guid><description>Real SQL practice needs real-looking data. Generate hundreds of customers with Python&amp;#39;s Faker library without downloading a single CSV</description></item><item><title>Zero-Setup SQL: Run your first SQL query in under 5 minutes with DuckDB</title><link>https://jamalhansen.com/blog/run-your-first-sql-query-in-under-5-minutes/</link><pubDate>Sat, 10 Jan 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/run-your-first-sql-query-in-under-5-minutes/</guid><description>Install DuckDB with pip, create your first table, insert data, and run a SQL query - all in Python, all in under 5 minutes, zero configuration required</description></item><item><title>I know Python; Why learn SQL</title><link>https://jamalhansen.com/blog/i-know-python-why-learn-sql/</link><pubDate>Mon, 05 Jan 2026 00:00:00 +0000</pubDate><guid>https://jamalhansen.com/blog/i-know-python-why-learn-sql/</guid><description>Learning SQL will make you a better Python developer, even if you already use pandas and ORMs. The first in a series of posts that will walk you through the fundamentals using DuckDB and Python.</description></item></channel></rss>