top of page

DuckDB isn't just fast SQL. It's Python, SQL and compression all in one box.

I thought DuckDB was fast SQL with great compression. Speeds are lightning fast - I was happy with that. Then I went through Jasja De Vries's 30-day DuckDB series. Day by day. All 30.


Turns out I was using maybe 10% of what it can do.


My analyst and data scientist friends, DuckDB isn't just fast SQL. It's Python, SQL and compression all in one box.


Here're some features I didn't know existed:


▸ SELECT EXCLUDE - SELECT EXCLUDE (col1, col2) - grab everything except specific columns. SQL can't do this


▸ Prefix-aliasing - total: price qty instead of price qty AS total - name comes first. Reads left-to-right.


▸ Reusable aliases - Define alias in SELECT, use it in WHERE, GROUP BY, ORDER BY. SQL forces you to repeat the expression.


▸ LIMIT with % - LIMIT 10% instead of row counts. SQL doesn't have this.


▸ QUALIFY - Filter on window functions directly. SQL requires a nested subquery.


▸ BY ALL - GROUP BY ALL, ORDER BY ALL - SQL requires listing every column.


▸ LIST comprehensions - [x*2 FOR x IN scores IF x > 70] - Python syntax inside SQL.


▸ Lambda functions - list_filter(arr, x -> x > 10) - SQL has no lambdas.


▸ Dot operator chaining - price.CAST(FLOAT).ROUND(2) - method chaining like Python.


▸ Glob patterns - SELECT FROM 'logs/.csv' - query 1000 files with one line.


▸ Direct file queries - SELECT * FROM 'data.parquet' - no CREATE TABLE needed.


If you work with SQL, SAS, or Python for analytics - this series from Jasja fills gaps you didn't know you had.


Full 30-day series: https://eli5.eu/blog/index.html


Amazing work from Jasja.

 
 

Recent Posts

See All
bottom of page