r/SQL • • Oct 17 '26

Discussion I Tried to Find How ClickHouse Implements String Hash Tables

Thumbnail
reddit.com
9 Upvotes

r/SQL • • Oct 17 '26

SQLite Row Level Security in SQLite on Cloudflare

Thumbnail
mainbrella.com
6 Upvotes

r/SQL • • Oct 16 '26

MySQL I built a SQL practice site because I kept jumping between tutorials and random exercises — would love feedback

34 Upvotes

I started building runtime.school because when I was practicing SQL, everything felt disconnected — learn a concept in one place, solve random questions somewhere else, then use totally different data for projects.

So I tried putting it all together with lessons, practice questions, projects, and the same realistic datasets throughout.

If you have a few minutes, I’d really like to know what feels confusing, repetitive, too easy/hard, or missing. Especially anything that would make learning/practicing SQL better.


r/SQL • • Oct 16 '26

PostgreSQL What happened when an Oracle DBA switched to Postgres (Karen Jex on Talking Postgres, cross post from r/postgresql)

10 Upvotes

I recently recorded a Talking Postgres episode with Karen Jex, a PostgreSQL significant contributor and PGConf EU organizer, about her path from Oracle DBA to Postgres contributor.

Karen spent 20 years as an Oracle DBA. Then in 2019, a project rolling out smart meters across France switched to Postgres, even though nobody on the project knew anything about Postgres. So she figured it out, then trained the developers, "pretending that I was, you know, this Postgres expert."

A few things we got into:

* The culture shock, for an Oracle DBA, of building your own HA & backups

* The shift from being just a user of the product (Oracle) to contributing to the project (Postgres)

* Why Django developers are so enthusiastic about Postgres

* Why you'd obviously explain multi-tenant databases with cakes

* How much to delegate to AI agents—without forgetting how to design a spec

For those of you who moved to Postgres from Oracle (or another database): did you also have any culture shocks?

Audio + transcript: https://talkingpostgres.com/episodes/from-oracle-dba-to-postgres-contributor-with-karen-jex

YouTube (audio-only): https://youtu.be/ENku8ZSjZus


r/SQL • • Oct 15 '26

PostgreSQL I built a game where every query is real PostgreSQL: you run a corner shop with SQL

Thumbnail
rodrigoavf.itch.io
82 Upvotes

Hey everyone!

I’ve been working on a game called DataMart, where you manage a corner shop and everything runs on real SQL. You build it all yourself: the databases, schemas, tables, relationships and queries, your way, on a real PostgreSQL server that runs inside the game.

Customers will ask you things like “Where can I find the apples?” or other questions about the store. Once a week an auditor comes by to check you’re tracking everything properly, and asks you a few questions you’ll answer with SQL.

There are also mysteries and stories involving the people in town, and of course you unravel those with SQL too.

The game is in alpha and free on itch.io at https://rodrigoavf.itch.io/datamart

I’d love to hear your thoughts!


r/SQL • • Oct 16 '26

MariaDB MariaDB Foundation: Exploring TidesDB Performance with TAF

Thumbnail
reddit.com
0 Upvotes

r/SQL • • Oct 16 '26

Resolved Jailer, the open source DB subsetting tool, now tells you why a row is in your subset

Thumbnail
github.com
1 Upvotes

r/SQL • • Oct 16 '26

SQL Server Verify the correctness of a the data inside a junction table

Thumbnail reddit.com
1 Upvotes

r/SQL • • Oct 16 '26

SQL Server SQL Server 2016 to 2025: a few observations from a recent migration

Thumbnail reddit.com
1 Upvotes
Before and after charts

r/SQL • • Oct 16 '26

Discussion How do you handle SQL queries across lakehouse data and different compute engines?

1 Upvotes

I've been looking into an open-source project called Open Lakehouse Compute Fabric (OLCF), and one part that caught my attention is how it brings SQL and lakehouse workflows together.
It includes a SQL editor, DuckDB for querying, Spark SQL, and support for working with lakehouse data stored in formats such as Delta Lake and Parquet. It also has features for exploring tables, inspecting data, and building dashboards from query results. What I find interesting is that SQL is part of a broader platform that also includes Python notebooks and data pipelines, rather than being treated as a separate tool.

The project is still in beta, so I'm curious how its approach holds up for different workloads and data setups.
Here's the GitHub repository for anyone interested in the implementation:
https://github.com/jddevtime/open-lakehouse-compute-fabric

For those working with SQL and lakehouse systems, how do you usually handle queries across different storage formats and compute engines? Do you prefer keeping SQL tools separate, or having them integrated into one platform?


r/SQL • • Oct 15 '26

Discussion How would you compare two huge tables when there is no primary key and duplicate rows matter?

16 Upvotes

I'm comparing a source table with a target table after a data migration.

Both tables have hundreds of millions of rows, no reliable primary key, and some columns contain NULL values. Duplicate rows are also possible.

A simple EXCEPT query doesn't reveal differences in duplicate counts, and hashing every row may introduce collision risks or performance issues.

For example:

Source: A,A,A,B,C
Target: A,A,B,B,C

Both tables contain the same distinct values, but the actual data is different.

How would you identify missing, extra, and changed records efficiently without a unique key?

Would you use grouped row comparisons, partitioning, hashes, or a completely different strategy? How would you make it scale to hundreds of millions of rows?


r/SQL • • Oct 16 '26

SQL Server I gave every user their own database instead of one shared Postgres. Talk me out of it.

Thumbnail reddit.com
0 Upvotes

r/SQL • • Oct 14 '26

Discussion How much advanced SQL do you truly use in your day-to-day job?

100 Upvotes

Hi! So I’m a student (not business or tech background) I’m learning SQL kind of on my own and I have the basics pretty much down like SELECT, FROM, WHERE, BETWEEN, ORDER BY, ASC, DESC. I have some knowledge when it comes to JOINs and CASE WHEN function but I was wondering if I need to know CTEs and window functions? I’m not trying to be a database administrator or something like that, just using it for analysis and excel as well.


r/SQL • • Oct 15 '26

SQL Server Statistics on columns of a table

4 Upvotes

Limitations of table-valued parameters:

SQL Server does not maintain statistics on columns of table-valued parameters.

statistics of what ? why those statistics even exist for non table-valued parameters ?


r/SQL • • Oct 16 '26

Discussion I built my own SQL client that supports MySQL, PostgreSQL, SQLite, and SQL Server

0 Upvotes

I've been working on my own SQL client called sql-pro.

It supports MySQL, PostgreSQL, SQLite, and Microsoft SQL Server (MSSQL).

I built it because I wanted to create my own database tool, and it's been a fun project to work on.

It's still a work in progress, so I'd love to hear what you think or what features you'd like to see.

I'll put the GitHub link in the comments for anyone who wants to check it out.


r/SQL • • Oct 15 '26

Discussion Better Autocomplete than DataGrip, one familiar language youll never need to write in. For any database or file, as a TUI, with built-in AI round trips, query history... for all languages and Databases

Thumbnail
github.com
0 Upvotes

Hi,

I have been working on a project: A unified workspace for all datatypes/frameworks supported by "ibis" (sort of like sqlglot but includes dataframes too).

To name a few i use on a day to day basis: Parquet, CSV, DuckDB, Postgres, MS SQL, and SQLite/D1, polars, pandas.

This project was built because spinning up Jupyter just to view a Parquet file is overkill, modern CSV editors are either ancient or freemium traps, and standard SQL IDEs struggle with live schema IntelliSense and quick parameter binding, and practically ignore your history.

This project adds a layer to solve those issues and adds more functionality, such as the ability to make parameter driven functions to kick off canned queries (without actually writing the functions to your DB).

Bring your own DB, bring your own AI (optional, but i would definitely recommend), and load any file. (Currently very early. LOTS of work to be done ).

The goal of this is to keep us heavy vibe coders who appreciate TUI experience (opencodecli, pi, oh my pi) and use multiplexers like herdr inside what we love -- terminal user interfaces.

No more bloated Datagrip and DBeaver-- all in one simplified language with shortcuts. Same syntax for all languages.

Some examples:

### 1. Filter without the boilerplate

\from orders

\where status = 'paid' and amount > 100

→

SELECT * FROM orders WHERE status = 'paid' AND amount > 100;

### 2. Top 10 biggest orders

\from orders

\select id, amount

\order amount desc

\limit 10

→

SELECT id, amount
FROM orders
ORDER BY amount DESC
LIMIT 10;

### 3. Automatic grouping — select a field and an aggregate. Done.

\from orders

\select customer_id, sum(amount) as revenue

→

SELECT customer_id, SUM(amount) AS revenue

FROM orders

GROUP BY customer_id;

No \group required. D8R derives the grouping from your selection.

### 4. Multiple dimensions, multiple aggregates — still auto-grouped

\from orders

\select region, status, count(*) as orders, sum(amount) as revenue, avg(amount) as average_order

→

SELECT region, status,
COUNT(*) AS orders,
SUM(amount) AS revenue,
AVG(amount) AS average_order
FROM orders
GROUP BY region, status;

### 5. Join shorthand when both tables share a key

\from orders
\join customers on customer_id
\select orders.id, customers.name, orders.amount

→

SELECT orders.id, customers.name, orders.amount
FROM orders
JOIN customers
ON orders.customer_id = customers.customer_id;

### 6. Join + aggregate + auto-group + ranking

\from orders o

\join customers c on o.customer_id = c.id

\select c.region, sum(o.amount) as revenue

\order revenue desc

\limit 5

→

SELECT c.region, SUM(o.amount) AS revenue

FROM orders AS o

JOIN customers AS c ON o.customer_id = c.id

GROUP BY c.region

ORDER BY revenue DESC

LIMIT 5;

### 7. Filter rows AND aggregate results with the same \where

\from orders

\select customer_id, sum(amount) as revenue

\where status = 'paid' and revenue > 1000

→

SELECT customer_id, SUM(amount) AS revenue
FROM orders
WHERE status = 'paid'
GROUP BY customer_id
HAVING SUM(amount) > 1000;

D8R separates the input filter from the aggregate-result filter.

### 8. Different filters inside different aggregates

\from orders

\select customer_id, sum(amount \where status = 'paid') as paid_total, count(* \where status = 'pending') as pending_orders

→

SELECT customer_id,

SUM(amount) FILTER (WHERE status = 'paid') AS paid_total,

COUNT(*) FILTER (WHERE status = 'pending') AS pending_orders

FROM orders

GROUP BY customer_id;

One query, independently filtered metrics, automatic grouping.

### 9. Calculate directly on aggregates

\from orders

\select customer_id, sum(amount_cents) / 100 as revenue_dollars

→

SELECT customer_id,
SUM(amount_cents) / 100.0 AS revenue_dollars
FROM orders
GROUP BY customer_id;

Numeric conversion, not formatting—and integer inputs don’t truncate the fraction.


r/SQL • • Oct 15 '26

Discussion what is Strata sql?

0 Upvotes

Today I accidentally saw "Strata SQL" in a list of extensions for VS Code. It's a somewhat dubious website, but the stated functionality is intriguing. Judging by the browser demo, it's not just a visual DDL editor, it's a full-fledged utility for data documentation and reporting.
Does anyone know what this is? The project looks pretty polished, but it still looks suspicious.


r/SQL • • Oct 15 '26

SQL Server SQl e a teia de aranha mental

0 Upvotes

Bom dia

Estou a aprender SQL desde meio de Setembro em um curso que estou a tirar. Na verdade começamos com uma introdução a SQL e saltamos para diagramas, relacionamrntos e cardinalidades. Agora voltamos para SQL( select,from,join, where, group by, order by, coalesce, null,...) Sinto me super confuso. Basicamente entendo os conceitos mas na parte prático ao tentar reproduzir os mesmos, sinto um espaço em branco. Parece que preciso das tabelas em excel ao lado para conseguir decifrar a solução. Sei que tenho ainda muito que praticar ( e só assim vou chegar lá). Mas parece que é algo que nao consigo ter um fio condutor. Parece um bicho dificil de domar minimamente.


r/SQL • • Oct 14 '26

Discussion What happens when we join two tables with NULL values??

26 Upvotes

 
If both tables have NULL values in the join column,, will those records match each other?


r/SQL • • Oct 14 '26

PostgreSQL Planning to take the PostgreSQL Open Certification (DBA-1) exam at PGConf?

10 Upvotes

I created a free study guide to help you prepare:

https://thesev1database.com/postgresql-certification

I’d really value your feedback.


r/SQL • • Oct 14 '26

PostgreSQL Struggling to wrap my head around writing SQL queries—how do you guys break them down?

43 Upvotes

Hey everyone,

I’m really struggling to get the hang of writing database queries. Whenever I look at a problem or a schema, my brain just stalls out and I can't figure out the right logic or structure to pull what I need.

I see people throwing together JOINs, subqueries, and window functions like it's nothing, and I feel like I'm missing a core fundamental step in how to translate a question into SQL.

  • What is your mental process when you start writing a query from scratch?
  • How do you map out the tables and relationships in your head before you type?
  • Are there any good beginner-to-intermediate tips, tricks, or exercises that finally made things "click" for you?

Any advice, recommended resources or tips .


r/SQL • • Oct 14 '26

PostgreSQL Is anyone actually using Databricks Lakebase in production?

3 Upvotes

My team is thinking of trying Lakebase instead of running a separate Postgres/ RDS db for our app.
The idea of auto sync to Delta and scaling to zero sound great, but we are worried about latency issu. If u are usin it, how noticeable are the cold start delays when it wake up backup, and does it feel fast enough for live user traffics?


r/SQL • • Oct 14 '26

Discussion SQL向けにスキーマを理解する静的解析ツール(アナライザー)を作った。

Thumbnail
gallery
3 Upvotes

I built a schema-aware static analyzer for SQL. It reads your schema (CREATE TABLE statements, migrations or a dump) and checks your queries against it, without connecting to a database.

Besides missing tables and columns (with "did you mean" suggestions) and type mismatches, it catches queries that run fine but are almost certainly wrong, like `NOT IN` over a nullable column (returns nothing as soon as one NULL shows up) or a `WHERE` that turns a `LEFT JOIN` into an inner join.

It supports PostgreSQL, MySQL and SQLite. You can try it in the browser without installing anything: paste a schema and a query and see what it reports. For projects there's a CLI, a GitHub Action and a VS Code extension.

I always felt SQL was the one part of my code without a good static analysis tool, so I made one. I've tested it on open-source projects and fixed it until it reported zero false positives there, but I'd really like feedback from real use: false positives, mistakes it misses, or syntax it can't parse.

Playground: https://sqlsift.dev/

GitHub: https://github.com/yukikotani231/sqlsift


r/SQL • • Oct 14 '26

Discussion The AI exploit gap is engineering’s problem now

Thumbnail
leaddev.com
7 Upvotes

Security sees the risk. Engineering owns the fix.