SQL
SQLBolt & SQL Teaching are nice SQL intros.
dsq is neat. SQL Indexing and Tuning book has many tips. PRQL & GlueSQL seem nice too.
Arctype is a nice tool. ReadySet is great SQL caching engine.
Partial State in Dataflow-Based Materialized Views is nice paper on which ReadySet & Noria are based.
Interested in using Malloy to query my Postgres db as it's plenty fast and is more ergonomic than SQL to use. It's query language reminds me of EdgeQL by EdgeDB.
Code
sql
-- get schema for table users
pragma table_info(users);
Notes
- High cardinality = unique. Low cardinality = less unique.
- Nice to alias tables by their first letters. i.e.
supplier_domains sd
orsupplier_inferred_properties sip
. Then can use the alias assd.
inselect
clause. - When you have a problem, build two solutions - a deep Bayesian transformer running on multicloud Kubernetes and a SQL query built on a stack of egregiously oversimplifying assumptions. Put one on your resume, the other in production. Everyone goes home happy.
Links
- Learn SQL the hard way
- Quick SQL cheat sheet - Quick reminder of all SQL queries and examples on how to use them.
- SQLCheck - Automatically identify anti-patterns in SQL queries.
- SQL Fundamentals course
- Q - Run SQL directly on CSV or TSV files. (Docs) (HN) (HN)
- Learn Modern SQL with PostgreSQL (HN) (Solutions)
- PartiQL - SQL-compatible access to relational, semi-structured, and nested data. (Rust Code)
- BlazingSQL - Lightweight, GPU accelerated, SQL engine built on RAPIDS.
- Ways to Tweak Slow SQL Queries (HN)
- osquery - SQL powered operating system instrumentation, monitoring, and analytics. (Web) (osquery launcher)
- SQL queries don't start with SELECT (2019)
- OctoSQL - Query tool that allows you to join, analyze and transform data from multiple databases and file formats using SQL. (HN)
- SQL Murder Mystery - Designed to be both a self-directed lesson to learn SQL concepts and commands and a fun game for experienced SQL users to solve an intriguing crime. (HN)
- usql - Universal command-line interface for SQL databases. (HN)
- SQL Performance Explained book
- How a SQL database works (2019) (HN)
- When an SQL database makes a great Pub/Sub (2019) (HN)
- Cosette - Automated SQL solver.
- BlazingSQL - GPU accelerated SQL engine built on top of the RAPIDS ecosystem. (Web)
- libinjection - SQL / SQLI tokenizer parser analyzer.
- SQL Tutorial for Beginners (2020)
- SQL Koans - Set of koans to introduce you to SQL. (Code)
- eSQLate - Build minimum viable admin panels quickly with just SQL.
- Presto - Distributed SQL Query Engine for Big Data. (Code) (Using SQL to query Kafka, MongoDB, MySQL, PostgreSQL and Redis with Presto)
- SQL Language Server
- The rise of SQL-based data modeling and DataOps (2019) (HN)
- NULL Values in SQL Queries (2020) (HN)
- RapidQL - Join, combine, and aggregate data from multiple APIs and databases — all in one call. (Code)
- sqlfmt - SQL Formatter.
- Domain Logic and SQL (2013) (HN)
- Database basics: writing a SQL database from scratch in Go (2020) (HN)
- sqls - Implementation of the Language Server Protocol for SQL.
- Compiling PL/SQL Away (2019)
- Constexpr SQL - Light weight single header alternative to DBMS.
- SELECT wat FROM sql (HN)
- Advanced SQL and database books and resources (2020) (HN)
- Medium-hard SQL interview questions (HN)
- SQL Police Department – Learn SQL while solving crimes (HN)
- Preventing SQL injection: a Django author's perspective (2020)
- SQL for the rest of us
- Demystifying JOIN Algorithms (2019)
- SQLsmith - Random SQL query generator.
- forma - Opinionated SQL formatter.
- [How Does SQLAlchemy Manage Database Transactions? (2019)https://capnfabs.net/posts/sqlalchemy-connection-management/)
- Falcon - Free, open-source SQL editor with inline data visualization.
- querycafe - Import, query, and share any dataset.
- AlaSQL - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL).
- RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers (2020) (Code)
- Some SQL Tricks of an Application DBA (2020) (Lobsters)
- Scaling relational SQL databases (2020) (HN)
- The Troublesome Active Record Pattern (2020) (HN)
- Implementing subqueries in go-mysql-server (2020)
- We Can Do Better Than SQL (2019) (Lobsters) (HN)
- How to level up your SQL skills (2019) (Lobsters)
- Lateral Joins and Demand-Driven Queries (2020)
- SQL Templates
- PopSQL - Collaborative SQL editor for teams.
- Nested SQL Queries
- GlueSQL - SQL Database Engine as a Library. (HN)
- TS SQL - SQL database implemented purely in TypeScript type annotations. (Tweet) (HN)
- Simple Anomaly Detection Using Plain SQL (2020) (Lobsters) (HN)
- A Short Story About SQL’s Biggest Rival (2020) (HN)
- What ORMs Have Taught Me: Just Learn SQL (2014) (HN)
- SQL Formatter - JavaScript library for pretty-printing SQL queries. (Code)
- SQL Joins Visualizer - Help to you build SQL JOIN between two tables by using of Venn diagrams. (Code)
- Top 10 Most Important SQL Commands to Know (2020)
- Automate Business Logic With Logic Bank - Rule engine automates SQLAlchemy update logic for remarkable agility - 40X more concise. Scalable. Extensible and manageable using Python. (Tweet)
- SQL overview (Code)
- CloudQuery - Transform your cloud config and metadata to SQL. (Code)
- mfsqlchecker - Statically validate correctness of all your SQL queries. TypeScript, PostgreSQL.
- SQLiterally - Lightweight SQL query builder.
- sqlmap - Automatic SQL injection and database takeover tool. (Web)
- SQL Conventions
- SQLFlow - Brings SQL and AI together. (Web)
- Practical SQL (2022) - Beginner’s Guide to Storytelling with Data. (Code)
- Recursion in SQL Explained Visually (2020)
- FuseQuery - Distributed SQL Query Engine at scale. (Web)
- Introduction to Window Functions in SQL (2020) (HN)
- Preql - Interpreted relational query language that compiles to SQL. (Lobsters)
- What can we learn from SQL's 50 year reign? A story of 2 Turing Awards (2021) (Lobsters)
- SQL Next Steps: Optimization (Code)
- The surprisingly difficult problem of user-defined order in SQL (2018) (HN)
- Why SELECT * is bad for SQL performance (2020) (HN)
- Use The Index, Luke - SQL indexing and tuning tutorial for developers.
- SQL and aggregated data: is there a better way?
- Double-thinking in SQL (2009)
- Objection to ORM Hatred (2019) (HN) (HN)
- Lobsters: Why is SQL so successful? (2021)
- How Materialize and other databases optimize SQL subqueries (2021)
- Advanced SQL Questions From Amazon (2021)
- Streaming SQL: What is it, why is it useful? (2021)
- Steampipe - Extensible SQL interface to your favorite cloud APIs. (Code) (HN)
- Speeding up SQL queries by orders of magnitude using UNION (2021) (HN)
- Some opinionated thoughts on SQL databases (2021) (Lobsters)
- How to create a 1M record table with a single query (2021)
- fselect - Find files with SQL-like queries.
- Thinking in Questions with SQL (2021)
- Best practices for writing SQL queries (HN)
- Arctype - Fast and easy-to-use SQL client. (HN)
- Don’t we all just want to use SQL on the front end? (2021) (HN)
- TinySQL - Course designed to teach you how to implement a distributed relational database in Go.
- Ask HN: Is there a way to efficiently subscribe to an SQL query for changes? (2021)
- Practical SQL for Data Analysis: What you can do without Pandas (2021) (HN)
- sqlbench - Measures and compares the execution time of one or more SQL queries.
- Efficient SQL on Pandas with DuckDB (2021)
- SQL - SQL injection protection module.
- DuoRAT: Towards Simpler Text-to-SQL Models (2020) (Code)
- SQL Jobber - Lightweight SQL job-server for scaling read queries. (HN)
- SQL Query Optimization: Understanding Key Principle (2021) (Reddit)
- SQLizer - Easily convert files into SQL Databases. (Blog)
- sql-lint - Does sanity checks on your queries as well as bring errors back from the DB.
- Actual order of execution of SQL
- sqlgg - SQL Guided (code) Generator. (Web)
- sqldef - Idempotent MySQL/PostgreSQL schema management by SQL. (Web)
- SQL Fiddle - Application for testing and sharing SQL queries.
- TextQL - Execute SQL against structured text like CSV or TSV.
- SQL Join Types Explained in Visuals (2021) (HN)
- Against SQL (2021) (HN) (Lobsters)
- SQLBolt - Interactive lessons and exercises to learn SQL. (HN)
- Load CSV files and write SQL (HN)
- Why you should learn SQL (2019) (HN)
- Write an SQL query builder in 150 lines of Python (2021) (HN)
- SQL vs. NoSQL Is the Wrong Distinction (2021) (HN)
- Cloud Infrastructure as SQL (HN)
- SQL Explorer - Easily share data across your company via SQL queries.
- fsql - Find files with SQL.
- A single person answered 76,229 questions about SQL on StackOverflow (HN) (Reddit)
- Why NoSQL (HN)
- What ORMs have taught me: just learn SQL (2014) (HN)
- ZetaSQL - Analyzer Framework for SQL.
- SQL for Distributed Systems (2021) (HN)
- sqlcommenter - Suite of middlewares/plugins that enable your ORMs to augment SQL statements. (Code)
- What is a slow SQL query? (2021)
- xyr - Lightweight, simple, and powerful data ETL platform that helps you to query available data sources using SQL.
- go-mysql-server - SQL engine which parses standard SQL (based on MySQL syntax) and executes queries on data sources of your choice.
- List of MySQL joins types
- SQL: The difference between WHERE and HAVING (HN)
- trdsql - CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. Can output to various formats.
- Trino - Distributed SQL query engine for big data. (Code) (Getting Started) (A decade of query engine innovation) (HN)
- Better SQL JOINs (2021)
- Running SQL JOINs on multiple CSV files
- PGSpider - High-Performance SQL Cluster Engine for distributed big data.
- SQL language proposal: JOIN FOREIGN (HN)
- Dremio - SQL Data Lakehouse Platform for High-Performance BI. (Code)
- SQLPad - Web-based SQL editor run in your own private cloud.
- tree-sitter-sql - SQL grammar for tree-sitter.
- Graph Pattern Matching in GQL and SQL/PGQ (2021)
- Dsq - Command line tool for running SQL queries against JSON, CSV, Excel, Parquet, and more. (Article) (HN) (March 2022 update)
- Treating SQL like code (2022) (HN)
- SQL Formatter - Polyglot SQL formatter. (Code)
- Sqllogictest - Program designed to verify that an SQL database engine computes correct results by comparing the results to identical queries from other SQL database engines. (Sqllogictest-rs)
- PRQL - Modern language for transforming data — a simpler and more powerful SQL. (HN) (HN) (Web) (HN) (HN)
- PRQL Query - Query and transform data with PRQL.
- Malloy - Experimental language for describing data relationships and transformations. (HN) (Web)
- SpyQL - SQL with Python in the Middle. (HN)
- Bdash - Simple SQL Client for lightweight data analysis.
- StackQL - Query, provision and operate Cloud and SaaS resources and APIs using an extensible SQL based framework. (Code)
- XNGIN - SQL Engine built from scratch in Rust.
- Ask HN: Tools to visualize data in SQL databases? (2022)
- Rivers and Axis (2022) - How to format SQL queries.
- mgrt - Simple SQL migrations.
- Learn SQL with Datasette
- SeaSchema - SQL schema management suite.
- SQL Injection in a Parameterized Query (HN)
- SQLreduce - Reduce verbose SQL queries to minimal examples.
- Understanding Bitemporal Data (2022)
- sqlfmt - Opinionated SQL Formatter. (Code)
- Postgrator - PostgreSQL, MySQL, and SQL Server migration tool using plain sql scripts.
- Animate SQL - Visualize SQL Queries. (HN)
- RestQ - Compacting the SQL into the URL rest API.
- Is SQL going out of fashion? (2022)
- ReadySet - Same database, (much) faster queries. SQL caching engine. (Intro) (HN) (Code) (HN)
- Surveying 10+ SQL parser libraries in a few high-level languages (2022)
- Sneller - Vectorized SQL for JSON at scale: fast, simple, schemaless.
- Open Source SQL Parsers (2021) (HN)
- More SQL Parsing - Parse SQL into JSON so we can translate it for other datastores.
- Analyzing iMessage with SQL (2022)
- Balsa - Learned SQL query optimizer. It tailor optimizes your SQL queries to find the best execution plans for your hardware and engine.
- Learn BigQuery
- SQL Graphviz - Python 3 script that generates a Graphviz visualization of a SQL schema dump.
- Functional Programming on Top of SQL Engines (2022)
- What is the difference between single and double quotes in SQL?
- Toy Query Engine & SQL interface
- DataFusion - Extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
- Essential elements of high performance applications: SQL indexes (2022)
- A Gentle(-ish) Introduction to Worst-Case Optimal Joins (2022)
- SQL Style Guide - Consistent code style guide for SQL to ensure legible and maintainable projects. (Code)
- SQL tricks and concepts you didn't know about - Aleksandra Sikora (2022)
- SQL Habit - Practical SQL course.
- Monaco SQL Languages
- Use Checkerboard Diagrams to Visualize Joins Instead of Venn Diagrams
- Semantic Diff for SQL (HN)
- ts-sql-plugin - TypeScript Language Service Plugin for SQL with a tagged template strings SQL builder.
- Having, a less understood SQL clause (2022) (HN)
- Nice intros to SQL
- Parsing SQL (HN)
- Set of useful SQL scripts
- The case against SQL formatting (2022)
- SQL Cheat Sheet
- A sequel to SQL? An intro to Malloy (2022) (HN)
- Ask HN: Does anyone else think SQL needs help? (2022)
- SQL syntax for tree-sitter
- SQLpage - SQL-only web app builder, empowering data analysts to build websites and applications quickly.
- Future Proofing SQL with Carefully Placed Errors (2022)
- What SQL database isolation level do you run at?
- TAPEX: Table Pre-training via Learning a Neural SQL Executor (2022) (Code)
- SQL Format - SQL Formatter written in Rust.
- SQL Teaching - Easiest tutorial to learn SQL.
- SQL grammar for BigQuery
- SQLforDevs - Next-Level Database Techniques for Developers Ebook. (HN)
- SELECT solution FROM aoc WHERE year = 2022
- UNION ALL, data types and performance (2022)
- SQL and M4 = Composable SQL (2022)
- I wrote a SQL engine in Python (HN) (Lobsters)
- Materialized View: SQL Queries on Steroids (2022) (Lobsters) (HN)
- Partial State in Dataflow-Based Materialized Views (2013)
- Easy, alternative soft deletion:
deleted_record_insert
(2022) - Opteryx - SQL Engine written in Python, designed for embedded and cloud-native environments.
- Writing a Python SQL engine from scratch (Lobsters)
- Atlas v0.9: SQL as a First-Class Citizen (2023)
- API Mismatch: Why bolting SQL onto noSQL is a bad idea (2023) (HN)
- QueryScript - SQL compiler that supports higher order abstractions and compiles to your favorite databases.
- Electric - Local-first SQL platform.
- Replacing a SQL analyst with 26 recursive GPT prompts (2023) (HN)
- pretty-xmlish - Pretty printing library for SQL.
- RaySQL - Distributed SQL Query Engine in Python using Ray.
- SQL should be your default choice for data engineering pipelines (2023)
- Ask HN: How do you test SQL? (2023)
- Enabling static analysis of SQL queries at Meta (2022)
- SQL Optimizer Labs - Build a SQL optimizer in 1000 lines of Rust using egg.
- Awesome SQL
- Building a SQL-like language to filter flows (2023)
- Type Constraints in 65 lines of SQL (2023) (HN)
- SQL Parser CST - SQL Parser which produces a Concrete Syntax Tree (CST).
- Stochastic gradient descent written in SQL (2023) (HN)
- CensusGPT - Natural Language → SQL. (Code)
- graph-sql - SQL storage implementation for graph data structures.
- Human to SQL Translator - Tool for converting natural language queries into SQL code using artificial intelligence. (Code)
- dbt_linreg - Linear regression in SQL using dbt.
- LeiSQL - SQL database.
- sqlfmt - SQL Formatter.
- AskBend - SQL-based Knowledge Base Search and Completion using Databend.
- SQL Chat - Chat-based SQL client. (Code)
- SQL:2023 is finished: Here is what’s new (2023) (HN)
- Lost at SQL - SQL learning game (HN)
- Sleek - CLI tool for formatting SQL.
- SQL Window Functions Explained
- SQL Anti-Patterns
- LLM powered agent that analyses SQL databases
- SQL: 2023 Has Been Released (HN)
- I Don't Need Your Query Language (2023) (Lobsters)
- Joins 13 Ways (2023) (HN)
- How to generate SQL statements with ChatGPT (2023) (HN)
- TreeSQL - SQL query extension for GraphQL-like nested query results.
- Introducing NSQL: Open-source SQL Copilot Foundation Models (2023)
- How to Check 2 SQL Tables Are the Same (HN)
- NSQL - Autoregressive open-source large foundation models (FMs) designed specifically for SQL generation tasks.
- Serra - Translate SQL to Object-Oriented Spark. (HN)
- Beyond SQL: A relational database for modern applications (2023) (HN)
- SQL Formatter (HN)
- Dataherald - Natural language-to-SQL engine built for enteprise-level question answering over structured data. (HN)
- Defog SQLCoder - SoTA LLM for converting natural language questions to SQL queries.
- sqlx-ts - Node.js compile-time SQL validations & type generations.
- Safely executing LLM-generated SQL (Lobsters)