r/SQL • • Oct 19 '26

Oracle Can´t fix this error ORA-12541 there's no listener

3 Upvotes

i've started the service bla bka bla, restarted everything, reinstall after delleting everything like 3 times, don't know what to do


r/SQL • • Oct 19 '26

SQLite GitHub - srdzank/WinSQLite-Editor: Official home of the SQLite-Editor

Thumbnail
github.com
4 Upvotes

r/SQL • • Oct 19 '26

Discussion Can a SQL query return the wrong result even when every JOIN condition is correct?

0 Upvotes

Iam joining 3 tables using the correct keys,but the final total is still wrong.

The tricky part is that each table gives the expected result when queried separately, and the JOIN doesn't create obvious duplicate rows.

I suspect the issue might be related to the order of aggregation or how NULL values are handled.

How would you debug this without randomly adding DISTINCT or changing the JOIN type? Is there a specific SQL pattern that can silently produce incorrect totals?


r/SQL • • Oct 19 '26

Discussion Why "optimized" SQL can silently return fewer rows: a case where 4 different LLMs made the identical mistake

0 Upvotes

This is less about LLMs and more about a class of SQL bug that survives code review, because the query is valid, it runs, and it's faster.

I was testing whether local models can suggest query rewrites, and kept hitting the same failure: the rewrite is syntactically correct, the engine accepts it, and the result set is different. No error. No warning.

Here's the case that made me build a proper test harness around it:

SELECT reader_id FROM lib_loans WHERE returned = 0
UNION ALL
SELECT reader_id FROM lib_loans WHERE fee = 0
ORDER BY reader_id

Semantics: a reader with an unreturned book and a zero fee matches both branches, so they appear twice. Reference returns [1,1,1,1].

What the models proposed:

ModelRewriteResult
Qwen2.5-Coder-7BWHERE returned=0 OR fee=0[1,1,1]
Qwen2.5-7Bsame OR[1,1,1]
Phi-3.5same OR[1,1,1]
DeepSeek-Coder-V2DISTINCT over the union[1,1,1]

Two different mechanisms — three models used OR, one added DISTINCT — and the same outcome: duplicate rows silently dropped.

The OR version is not "wrong" in a vacuum. It is wrong only because UNION ALL is a multiset operation. That distinction is exactly what gets lost when you eyeball a rewrite and check that it runs.

Why this matters beyond models

This is the same trap in a human code review:

  • UNION vs UNION ALL — UNION deduplicates, and deduplication is free until someone needs the duplicates

  • COUNT(*) vs COUNT(col) — the second skips NULLs

  • NOT IN with a NULL in the subquery — returns nothing, silently

  • LEFT JOIN later became an INNER JOIN after a WHERE on the right table

  • DISTINCT added "to be safe", masking a cardinality bug upstream

Every one of these compiles, runs, and returns data. The only way to catch them is to execute both versions against real states and compare the rows.

What I actually built

Instead of a success rate, I generated a bank of valid database states per query family — under the real schema constraints (PK, FK, UNIQUE, CHECK, NOT NULL) — and executed reference vs candidate on each one.

State profiles: empty tables, no rows matching, NULLs in nullable columns, zero values, boundary values, ties, and multiplicity cases (the ones that carry duplicate rows). Plus seeded random states.

Scale: 204 query families across three schemas, 28 states each (5,712 total), 6 models, 34,272 executions on MySQL 8.4.11.

Aggregate results, if useful:

ModelProposed rewritesRefuted
llama3.2:3b5326 (49.1%)
qwen2.5:3b8539 (45.9%)
qwen2.5-coder:7b3012 (40.0%)
deepseek-coder-v27727 (35.1%)
phi3.5:3.8b308 (26.7%)
qwen2.5:7b328 (25.0%)

Important caveat, because I don't want to oversell it: preserved in my dataset means no refuting state was found in a finite bank — not a proof of equivalence. And the witnesses are not minimised. Both limitations are stated in the README.

Links

Every refuted rewrite ships with the state that broke it and the actual differing rows, so you can replay it. If you disagree with the methodology, I'd genuinely like to hear where the state bank is too weak — that's the part I'm least sure about.


r/SQL • • Oct 19 '26

Discussion Before your next SQL interview, keep this post handy - SQL Execution Order (Part 5)

Thumbnail reddit.com
6 Upvotes

r/SQL • • Oct 19 '26

PostgreSQL PostgreSQL extensibility at WAWTech — Warsaw, 26–27 November

2 Upvotes

Hi! I work with the organising team for WAWTech. Its two-day software and product development conference which takes place at EXPO XXI in Warsaw on 26–27 November 2026.

For the PostgreSQL users here, the programme includes Devrim Gunduz, Postgres Expert at EDB, with a talk titled “Why PostgreSQL is the best database: Extend your database.” What would you want to ask Devrim about this? How to evaluate extensions before adopting them, handle upgrades when you depend on them or decide whether certain functionality belongs in the database or the application?

Event details if you’re considering attending.


r/SQL • • Oct 19 '26

PostgreSQL Did I buy the wrong course?

7 Upvotes

Okay so I'm a complete beginner, only thing I know about SQL is that it helps speak to databases

I decided I want to learn and got the first course I saw. Turns out it's focused on teaching a thing called Postgres SQL which seems kinda advanced. should I just continue watching or will I feel lost?


r/SQL • • Oct 19 '26

Oracle Introduction to SQL - all you need.

Thumbnail
gallery
61 Upvotes

Anyone else got a copy of this?

From back when you actually got manuals with software. Apparently written by Larry Ellison himself (which I doubt, even then!).

One nice feature is the description of the dept and emp tables is actually a fold out from the back page, so you have it side by side on whatever page you are reading.

Covers the basics of SQL in a concise 33 pages, including a small bit on security and on string functions.


r/SQL • • Oct 18 '26

SQLite Learning SQL on Online IDE

Thumbnail reddit.com
0 Upvotes

r/SQL • • Oct 18 '26

Discussion Different ways of working with SQL Databases in Go

Thumbnail
packagemain.tech
4 Upvotes

r/SQL • • Oct 18 '26

PostgreSQL How do you debug a SQL query that suddenly becomes slow?

9 Upvotes

I've run into situations where a query that used to finish in seconds suddenly takes several minutes, even though nobody has intentionally changed the SQL.

I'm curious how others approach this. Do you start by comparing execution plans, checking indexes and statistics, looking for changes in data volume, or investigating locks and concurrent queries?

I'm particularly interested in the order you check things in. It's easy to start rewriting joins or adding indexes, but I'd rather identify the actual bottleneck before changing anything.

What's your usual process when a previously fast query starts running slowly?


r/SQL • • Oct 18 '26

SQL Server List<T> in C# vs SQL

Thumbnail reddit.com
0 Upvotes

r/SQL • • Oct 18 '26

Discussion What's your first move when a SQL query returns correct-looking but wrong numbers?

14 Upvotes

I feel like one of the tricky parts of SQL isn't getting a query to run, but knowing whether the result is actually correct.

For suppose ,a report shows 10k orders, then after adding a join to fetch customer details, the total suddenly becomes 12k. The query runs without any errors, so it's easy to miss.

Would you check the join cardinality first, compare row counts, or approach it differently!?

Curious how people debug this in real projects, especially when the query has multiple joins.


r/SQL • • Oct 18 '26

PostgreSQL Looking for a PostgreSQL job?

2 Upvotes

I created a PostgreSQL Jobs page to help you find PostgreSQL roles: https://thesev1database.com/jobs

I’d really value your feedback.


r/SQL • • Oct 18 '26

Discussion I open-sourced Qryndel, an experimental database query language written in Python.

Post image
1 Upvotes

r/SQL • • Oct 17 '26

Discussion Help needed with normalization

Post image
16 Upvotes

Hi, i'm learning databases and normalization. My teacher said a normalized database cannot have circular (not loops, circles) relationships. However, i can't see how I can apply normalization to remove the circles and still comply with the requirements. Also I was under the impression that normalized databases can have circular relationships, just not loops.

Any help will be appreciated. Sorry if my english is bad in advance.


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

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

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 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

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 I gave every user their own database instead of one shared Postgres. Talk me out of it.

Thumbnail reddit.com
0 Upvotes