Hacker News with Generative AI: SQL

SQL nulls are weird (jirevwe.github.io)
Yes, you read that right. SQL does treat all NULL values differently. I learnt this a while back while working on Convoy and again on LiteQueue: a Golang a queueing library.
TiDB – cloud-native, distributed SQL database written in Go (github.com/pingcap)
TiDB (/’taɪdiːbi:/, "Ti" stands for Titanium) is an open-source, cloud-native, distributed SQL database designed for high availability, horizontal and vertical scalability, strong consistency, and high performance.
Advent of Code 2024 in pure SQL (blogspot.com)
On a whim I decided to do this years advent of code in pure SQL. That was an interesting experience that I can recommend to everybody because it forces you to think differently about the problems. And I can report that it was possible to solve every problem in pure SQL.
Show HN: Execute SQL against Bluesky firehose (github.com/turbolytics)
SQLFlow enables SQL-based stream-processing, powered by DuckDB. SQLFlow embeds duckdb, supporting kafka stream processing logic using pure sql.
SQL query optimization: a comprehensive developer's guide (aiven.io)
An SQL optimization guide for developers. With best practices, warnings, and pro tips to speed up your SQL query optimization.
Reads Causing Writes in Postgres (jesipow.com)
It is good practice to regularly inspect the statements running in the hot path of your Postgres instance. One way to do this is to examine the pg_stat_statements view, which shows various statistics about the SQL statements executed by the Postgres server.
SQLCipher – SQLite library that adds 256 bit AES encryption of database files (github.com/sqlcipher)
Leadership Power Tools: SQL and Statistics (blwt.io)
A common pattern I’ve seen over the years have been folks in engineering leadership positions that are not super comfortable with extracting and interpreting data from stores, be it databases, CSV files in an object store, or even just a spreadsheet.
Use Cases for ChDB, a Powerful In-Memory OLAP SQL Engine (runportcullis.co)
Clickhouse is quickly becoming a crowd favorite real-time data warehouse platform for organizations looking to take advantage of blazing fast query speeds in OLAP scenarios that power mission-critical applications and embedded analytics.
Litdb – type safe SQL for JavaScript/TS (litdb.dev)
litdb contains LINQ-like type-safe SQL builders for TypeScript/JavaScript for writing type-safe expressive SQL that's parameterized & portable across SQLite, MySQL & PostgreSQL
DSQL Vignette: Reads and Compute (brooker.co.za)
In today’s post, I’m going to look at half of what’s under the covers of Aurora DSQL, our new scalable, active-active, SQL database.
Show HN: SQL Simulator – Create Subsetted Databases in Docker or K8s (tribalknowledge.tech)
In laymen's terms SQL Simulator uses SQL scripts to generate subsetted databases within a secure Sandbox environment.
Writing Composable SQL Using Knex and Pipelines (lackofimagination.org)
SQL is great! It can handle complex queries involving multiple tables, aggregations, subqueries, and joins. It can perform CRUD (Create, Read, Update, Delete) operations. It enforces data integrity through constraints like primary and foreign keys. It supports transactions, allowing multiple operations to be executed as a single unit, which can be rolled back if one of the operations fails.
Show HN: Build you own SQL query planner/optimizer guide (github.com/tuannh982)
Towards Optimizing SQL Generation via LLM Routing (arxiv.org)
Text-to-SQL enables users to interact with databases through natural language, simplifying access to structured data.
Show HN: Trilogy – A Reusable, Composable SQL Experiment (trilogydata.dev)
This demo uses the popular TPD-DS dataset for transactional database benchmarking. You can read more about Trilogy and this benchmark tool here.
SQLite: Outlandish Recursive Query Examples (sqlite.org)
Common Table Expressions or CTEs act like temporary views that exist only for the duration of a single SQL statement. There are two kinds of common table expressions: "ordinary" and "recursive". Ordinary common table expressions are helpful for making queries easier to understand by factoring subqueries out of the main SQL statement. Recursive common table expressions provide the ability to do hierarchical or recursive queries of trees and graphs, a capability that is not otherwise available in the SQL language.
Runtime-Extensible SQL Parsers Using Peg (duckdb.org)
TL;DR: Despite their central role in processing queries, parsers have not received any noticeable attention in the data systems space. State-of-the art systems are content with ancient old parser generators. These generators create monolithic, inflexible and unforgiving parsers that hinder innovation in query languages and frustrate users. Instead, parsers should be rewritten using modern abstractions like Parser Expression Grammars (PEG), which allow dynamic changes to the accepted query syntax and better error recovery.
Usql: Universal command-line interface for SQL databases (github.com/xo)
Universal command-line interface for SQL databases
SQL style guide by Simon Holywell (sqlstyle.guide)
You can use this set of guidelines, fork them or make your own - the key here is that you pick a style and stick to it. To suggest changes or fix bugs please open an issue or pull request on GitHub.
Steps in Writing Analytical SQL Queries (crunchydata.com)
It is never immediately obvious how to go from a simple SQL query to a complex one -- especially if it involves intricate calculations.
Rust for tokenising and parsing (xnacly.me)
I am currently writing a analysis tool for Sql: sqleibniz, specifically for the sqlite dialect.
Why I love Rust for tokenising and parsing (xnacly.me)
I am currently writing a analysis tool for Sql: sqleibniz, specifically for the sqlite dialect.
I love Rust for tokenising and parsing (xnacly.me)
I am currently writing a analysis tool for Sql: sqleibniz, specifically for the sqlite dialect.
Show HN: IMDb SQL Best Movie Finder (imdb-sql.com)
DuckDB-GSheets: Read and Write Google Sheets in Pure SQL (github.com/evidence-dev)
Show HN: Intelcave – Business intelligence, redefined using AI (intelcave.com)
Chat with your database, create insightful collections and write SQL queries using simple conversational language.
INNER JOIN ON vs WHERE clause (2009) (stackoverflow.com)
For simplicity, assume all relevant fields are NOT NULL.
Graph Retrieval Using Postgres Recursive CTEs (sheshbabu.com)
Did you know you can use Postgres as a graph database for certain usecases?
Show HN: ClickHouse User Defined Table Function in Python (github.com/auxten)
I'm a SQL enthusiast and I want to query everything with SQL. This project is a collection of my experiments to query different data sources with SQL.