Literate SQL
Complex queries are hard to read. Literate SQL is about writing queries that are as easy to read as a good novel.
SQL has evolved. Beyond the relational model. Discover it now.
Visit modern-sql.com → RSS feedOn Hacker News Nov 2015 – Oct 2023
Complex queries are hard to read. Literate SQL is about writing queries that are as easy to read as a good novel.
These words cause problems as table or column name
The WITH clause adds named subqueries to SQL queries. WITH is also known as Common Table Expression (CTE).
PostgreSQL 11 offers the best OVER clause support among its competitors, true procedures, and improvements in FETCH FIRST and XML.
Pivot SQL tables with CASE or FILTER. Turn rows into columns for the entity-attribute-value model (EAV).
The FILTER clause extends aggregate functions (SUM, AVG, COUNT, etc.) with an additional WHERE clause. Databases not supporting FILTER can use CASE within the aggregate function instead.
MySQL is the last major SQL database that has evolved beyond SQL-92 by introducing window functions (OVER) and common table expressions (WITH [RECURSIVE])