r/SQL • • Apr 08 '26

Discussion Does SQL is getting the “developer experience” it deserves?

1 Upvotes

Sometimes, working with SQL feels like fragmented. I used to write queries in one tool, explain them in another, and paste the results somewhere else. It worked, but was messy in my opinion and not exactly reproducible as well. Lately though, I’ve been noticing a shift. SQL workflows are becoming more narrative, reproducible, and IDE‑native and honestly, it’s about time. For beginners, I am breaking it down:

  • Narrative SQL We’re moving past “just run the query.” People are mixing SQL and Markdown in the same environment, documenting why a query exists, what assumptions it makes, and what the results mean. And, when someone opens your query six months later, they don’t just see SELECT * FROM sales; they see the reasoning behind it.
  • Reproducibility: SQL is being treated like code now(finally!) versioned, linted, tested, and reviewed. Tools like dbt or SQLMesh made this normal, but even lightweight SQL notebooks are catching up. You can re‑run an analysis with the same inputs and get the same outputs, track changes, and collaborate safely.
  • IDE‑native workflows: We’re also seeing SQL move into the same environments developers already use, VS Code, JetBrains, etc. Inline results, query history, connection explorers, and Git integration are becoming table stakes. It feels less like “jumping into a separate tool” and more like writing real software.

Here’s are some tools and platforms I found that have “notebook‑style” or IDE‑native SQL workflow

  • Snowflake Snowsight browser‑based SQL worksheets with Markdown cells, inline charts, and shareable narratives.
  • Databricks SQL Notebooks supports Markdown + SQL + visualizations directly in the Databricks workspace.
  • Exasol SQL Notebooks directly into its VS Code extension **,** to write, run, and document queries inline, all saved as a single .exabook file.
  • BigQuery Notebooks (in Google Cloud Console) lets you mix SQL and Markdown, view results inline, and export to Colab.
  • Redshift Query Editor v2 – supports multiple statements, result tabs, and integrated charts; AWS is moving toward notebook‑like UX.

What do you prefer, keeping SQL inside your IDE or separate tools like dbt Cloud, DataGrip, Snowflake UI?


r/SQL • • Apr 08 '26

SQL Server Test multiple store procedure , how to automate

8 Upvotes

Hi, I need to do A /B testing for 100 MS Procs to run on dbA and dbB and compare results to make sure that at least number of rows is the same.

Each of procs returns different data and number of columns. I was trying to use u/rowcount but alas it doesn't work, always returns 0.
Is there any other relatively simple way to capture number of rows returned after each execution.
Is this somehow possible ?
Surely I can create some complex scripts, but I don't want to spend too much time, thinking that that execution stat should be stored somewhere ?
Or there is some other way ?

This is how I'm running my Procs, I can not open or modify them to run as a script to preserve integrity of testing.

Exec  dbA..proc100   100,200, 'Alpha'
Exec  dbB..proc100     100,200, 'Alpha'
Exec  dbA..proc100   333,200, 'Bravo'
Exec  dbB..proc100     333,200, 'Bravo'

THanks to all for help

VA

----------trying OpenRowSet. Looks like it doesn't work for complex SP, you need specifically find format for output for each sp. Also not sure can I include params into this syntax ?
Thanks again to all.

 INSERT INTO #t  
SELECT *
FROM OPENROWSET('MSOLEDBSQL', 'Server=SMBI100;Trusted_Connection=yes;','EXEC dbA.dbo.proc100 ');

Msg 11526, Level 16, State 1, Procedure sys.sp_describe_first_result_set, Line 1 [Batch Start Line 0]
The metadata could not be determined because statement 'INSERT #temp_counts......  uses a temp table.

r/SQL • • Apr 08 '26

PostgreSQL pgmodeler alternative?

1 Upvotes

Does anybody know of a good pgmodeler alternative?

I really like it as a product, but since they changed their licensing I can't support them in good conscience. I understand if you charge for new versions, but charging me again and again for a product that I already paid for? Nah.


r/SQL • • Apr 08 '26

MySQL MySQL syntax question

2 Upvotes

Hello, just a quick question. So I need to return a value back from a query but the number has decimals. I need to round it up to 2 decimal places but I have no idea how. Is there a function I am missing or something else?

Sorry if this does not make sense, basically, I get more that 2 decimals from a query but I want only 2, if that makes sense.


r/SQL • • Apr 07 '26

SQLite Browser-based SQLite Playground with real-time ER Diagrams (Free & Open-ish)

9 Upvotes
Northwind database loaded into the tool

Hey everyone!

A while back, I shared a project I started for my students: SQLite Playground. The goal was to create a tool with zero friction—no installation, no setup—just pure SQL learning.

Based on feedback from my students and the dev community, I’ve just rolled out some major updates that bring it closer to a full-blown (and free) IDE running 100% in your browser.

What’s New:

  • Automatic ER Diagram Visualizer: This is the big one. The diagram generates in real-time as you create or alter tables. If you add a Foreign Key, the relationship pops up instantly.
  • Full-Screen / Distraction-Free Mode: A clean interface designed for deep work or classroom presentations.
  • Import/Export (.db & .sqlite3): You can now load existing databases or save your progress directly to your machine.
Auto generated ER Diagram

What started as a simple classroom tool is evolving into a lightweight online SQL IDE. I’m really trying to bridge the gap between "beginner-friendly" and "feature-rich."

I’d love to get your feedback on the UX or any features you think are essential for a daily-driver SQL tool.

Check it out here: https://fasttools.dev/en/sql-playground

Cheers!


r/SQL • • Apr 07 '26

PostgreSQL If you have an SQL interview soon, don’t ignore these small things!!! (Part 6)

Thumbnail reddit.com
3 Upvotes

r/SQL • • Apr 08 '26

Discussion Online course on SQL with AI operators – interesting?

0 Upvotes

Hi!

I'm thinking about creating a (paid) online course introducing SQL with AI operators, enabling users to invoke large language models (LLMs) directly in their queries. E.g., something like this:

SELECT title, body
FROM `bigquery-public-data.bbc_news.fulltext`
WHERE AI.IF(
  ('The following news story is about a natural disaster: ', body),
  connection_id => 'us.your_connection'
);

Several companies offer similar features, for instance Snowflake Cortex, Google BigQuery, AlloyDB, ...

The course would introduce basic SQL concepts and AI operators, show how to use them in different systems, discuss strategies to keep computation costs reasonable etc. It would be an interactive online course, probably given over Zoom, with examples and exercises. I'm considering an intensive one-day version or weekly meetings, e.g., 90 minutes per week over three weeks.

I'm curious to hear whether anyone is interested or has recommendations on the format or topic selection. Thanks!


r/SQL • • Apr 07 '26

PostgreSQL ERD Review Request

0 Upvotes

Hello.

I am new to SQL. I am trying to design database that's a little more complicated than two tables & simple CRUD operations. My idea was to have some sort of system which is basically seniority based bidding. User's can bid on schedules, which are basically a collection of shifts. I seem to have hit a brick wall since I was not able to write a SELECT statement to get each users schedule based on their bid & seniority, so I added an "assigned_shift" table that will insert the data after I do calculation in the application side. Is this a good design?


r/SQL • • Apr 07 '26

Discussion ⚡️ SF Bay Area Data Engineering Happy Hour - Apr'26🥂

3 Upvotes

Are you a data engineer in the Bay Area? Join us at Data Engineering Happy Hour 🍸 on April 16th in SF. Come and engage with fellow practitioners, thought leaders, and enthusiasts to share insights and spark meaningful discussions.

When: Thursday, Apr 16th @ 6PM PT

Previous talks have covered topics such as Data Pipelines for Multi-Agent AI Systems, Automating Data Operations on AWS with n8n, Building Real-Time Personalization, and more. Come out to learn more about data systems.

RSVP here: https://luma.com/g6egqrw7


r/SQL • • Apr 07 '26

Discussion Qraft – A simpler way to work with SQL models [OSS, seeking feedback]

1 Upvotes

Every dbt project I've worked on starts the same way. Clean models, clear refs, a tidy schema.yml. Then, six months later, you open a macro file and wonder who wrote this — and why. The SQL is somewhere underneath, buried under three layers of Jinja that nobody wants to touch. You debug the template instead of the query. You read the macro to understand the model. Something went wrong, but it didn't happen all at once.

That's not a dbt flaw. It's what happens when a tool is too flexible for its own good. Jinja is a general-purpose templating engine grafted onto SQL workflows. It works — until teams discover they can do anything with it, and then they do everything with it. The tool didn't fail. The mismatch between Jinja's power and SQL's needs did.

So I built Qraft. Not to replace dbt entirely, but to answer a simpler question: what if the tool made overcomplication harder, not easier?

Qraft keeps what actually matters from the dbt workflow — ref(), source(), DAGs, materializations — and replaces Jinja with plain Python functions, called directly in SQL and expanded at compile time. No macro chains. No DSL to learn on top of your DSL. One project.yaml file for everything. The core runs in Rust via PyO3, so compilation stays fast and linear even at scale — we've tested up to 1,000 models.

It supports DuckDB, Trino, PostgreSQL, and MySQL. It auto-builds the DAG, detects cycles, validates references with typo suggestions, and runs models in parallel topological batches. Standard data tests are included. So is an auto-generated HTML catalog you can deploy as a standalone app — think dbt docs, but without the build step.

The goal isn't to be a niche tool for people who hate Jinja. It's to be something teams can actually adopt long-term — a common SQL foundation that data engineers, analytics engineers, and BI teams can all work from without translation layers between them.

But that's the long game. Right now, I want to know if it holds up outside my own projects. If you've fought with macro complexity in dbt, I'd genuinely like you to try it, break it, and tell me what would make you switch.

Repo and benchmarks here: github.com/ravidhu/qraft .


r/SQL • • Apr 06 '26

Discussion How do you handle data quality and validation in SQL workflows?

14 Upvotes

Hey all,

I’m part of a student team from the University of Minnesota and the University of Michigan researching data quality and validation in SQL-based workflows.

I’m curious how people are handling this in practice — things like:

  • writing validation queries or checks
  • catching data integrity issues early
  • keeping datasets clean over time

Would love to hear what approaches, patterns, or pain points you’ve run into.

If you’re open to sharing more structured input, we also put together a short survey (~10–15 min):
https://umn.qualtrics.com/jfe/form/SV_3QVlUfLaV30AFKe

Happy to share a summary of what we find back with the community.

Thanks!


r/SQL • • Apr 06 '26

PostgreSQL What is a Collation, and Why is My Data Corrupt? | PG Phridays with Shaun Thomas

0 Upvotes

Postgres has relied on the OS to handle text sorting for most of its history. When glibc 2.28 shipped in 2018 with a major Unicode collation overhaul, every existing text index built under the old rules became invalid... but silently. No warnings, no errors. Just wrong query results and missed rows.

Postgres 17 added a builtin locale provider that removes the external dependency entirely:

initdb --locale-provider=builtin --locale=C.UTF-8

This change helps sorting to become stable across OS upgrades. glibc is still the default in Postgres 18, so this must be specified when creating a new cluster.

For clusters already running: Postgres 13+ will log a warning when a collation version changes. That warning is an instruction to rebuild affected indexes.

Get more details here in this week's PG Phriday blog post from Shaun Thomas: https://www.pgedge.com/blog/what-is-a-collation-and-why-is-my-data-corrupt


r/SQL • • Apr 05 '26

SQL Server What mobile app do you use the most for SQL monitoring?

13 Upvotes

Hi, currently I’m out of my home country and would like to know what are the best Android apps to monitor and remote connect to SQL databases, as I don’t have access currently to a PC.


r/SQL • • Apr 05 '26

Discussion Portabase (open-source DB backup/restore tool): which databases would you like to see supported?

9 Upvotes

Hi everyone,

I’m one of the maintainers of Portabase, an open-source, self-hosted platform dedicated to database backup and restore. 

Repo: https://github.com/Portabase/portabase (any star would be amazing ❤️)

We currently support: PostgreSQL, MySQL, MariaDB, Firebird SQL, SQLite, MongoDB, Redis and Valkey.

We initially focused on SQL databases and recently started expanding into NoSQL. We’re now looking for feedback from the community on which databases are the most used and which ones would benefit most from being integrated into Portabase.

FYI: support for Microsoft SQL Server is already in progress.

Key features:

  • Multiple storage options: local, S3, Cloudflare R2, Google Drive
  • Notifications via Discord, Telegram, Slack, etc.
  • Scheduled backups with flexible retention policies
  • Ready-to-use Docker Compose and Helm Chart

So, which databases would you like to see next?

If you try Portabase, feel free to open an issue if you run into any bugs or have suggestions.

Happy Easter! 🐇


r/SQL • • Apr 03 '26

Discussion I've always felt the urge to draw on my generated charts, just added that feature to my SQL canvas side project

107 Upvotes

r/SQL • • Apr 03 '26

Discussion Why do most SQL interview questions feel nothing like real analyst work?

32 Upvotes

I’ve been preparing for SQL interviews and noticed most resources focus on random queries or syntax.

But actual interview questions seem much more like business problems:

- analysing churn / retention

- understanding funnel drop-offs

- balancing approval vs risk

I found those way harder because it’s less about syntax and more about deciding what to measure.

Curious if others found the same when preparing?


r/SQL • • Apr 04 '26

Resolved in a trigger, how to look at data on a different table from the one that has the trigger?

0 Upvotes

TLDR I'm trying to verify if an admin has the correct role to add data to a specific table (adminID being a foreign key on the table being called, and of course the primary key of the admin table), but i am getting this error:

>*Cause: A trigger was attempted to be retrieved for execution and was

>found to be invalid. This also means that compilation/authorization

>failed for the trigger.

>*Action: Options are to resolve the compilation/authorization errors,

>disable the trigger, or drop the trigger.

Here's how I've written the trigger so far:

>CREATE OR REPLACE TRIGGER validate_creation_role

>BEFORE INSERT ON participant

>FOR EACH ROW

>BEGIN

>IF admin(:NEW.adminID).role <> 'Participant maker' THEN

>RAISE_APPLICATION_ERROR(-20001, 'Invalid admin role for this task.');

>END IF;

>END;

(i know the var names are bad, i translated them for this post cause it's for a homework in a different language)

Thanks in advance!


r/SQL • • Apr 03 '26

MySQL Do you use VS Code with MySQL extension?

2 Upvotes

I built a small personal tool to improve my workflow when working with queries, and I’m looking for a few people to try it and give quick feedback (5–10 mins).

If you’re already running queries in VS Code (MySQL DB) , I’d really appreciate your help 🙏


r/SQL • • Apr 03 '26

SQL Server Friday Feedback: Startup options for SQL Server Management Studio (SSMS)

Thumbnail reddit.com
0 Upvotes

r/SQL • • Apr 02 '26

Discussion I am building SQL notebooks into an open source database client

37 Upvotes

Hi guys!

I've been working on Tabularis (open source cross-platform db client) and I'm working on a notebooks feature that i think people here might find interesting.

The core idea: SQL cells + markdown cells in a single document, running against your live database connection. no separate kernel, no python, just SQL.

The feature I keep coming back to is cell variable references, you write {{cell_3}} in your SQL and it takes the result set from cell 3 and injects it as a CTE. means you can chain analyses without building giant nested queries. for ad-hoc exploration this is a huge workflow improvement.

You also get:

  • inline charts: bar, line, pie. select label column + value columns, switch between types. nothing fancy but enough for quick visual checks
  • notebook parameters: define params once, use in all cells. good for parameterized reports
  • run all with stop on error: shows a summary of what succeeded/failed/skipped with links to the failing cells
  • parallel execution: mark independent cells with a lightning bolt, they run concurrently during run all
  • execution history: every cell tracks its last 10 runs, you can restore any previous query + result
  • csv/json export per cell, or export the whole notebook as self-contained HTML
  • drag & drop reordering, collapsible sections, resizable result panels

It supports all of databases supported by Tabularis.

The notebook file format is json-based (.tabularis-notebook).

There's a demo database + sample notebook in the repo under /demo.

Github: https://github.com/debba/tabularis
WIP Branch: https://github.com/debba/tabularis/tree/feat/notebooks

Feedback welcome, especially around the cell reference syntax and what else would make this useful for your workflow.


r/SQL • • Apr 02 '26

SQL Server Load data with BCP for columns with double "

2 Upvotes

Hi all,
I need to load txt file into SQL Server table, with bcp command
and see that few rows in file have TAB inside Column1 for ID=100 row, and these rows are not loaded (while good records are loaded). Those quotes exist only for selected columns/rows where TAB is inside, all others are without them.
How I can adjust my option to process those "Bad TAB" rows? Using -t"\"\t\"" as delimiter also doesn't work at all.

Unfortunetaly I don't have control over creation of these files.

Thanks

xp_cmdshell 'mydb.dob.logTable' in "\\network\ClientX.csv" -c -t"\t" -F 2 -T -S MyServ
ID    Colulmn1              Column2
100   "So  GDR KB5068404"   NotLoaded,TAB inside So\tGDR
200   So__GDR KB5068404     Loaded_OK

r/SQL • • Apr 02 '26

SQL Server Stored Procedure to TVF

2 Upvotes

Hello everyone,

I'm trying to make a function that query LDAP. I manage to do it no problem with Stored Procedure but now, I found out it cannot be used in a view. Thus, I'm trying to convert it to TVF. My code doesn't seems compatible with inline since I'm making a query then using the result to make a second query. I'm unsure how to make a TVF with that.

/****** Object:  StoredProcedure [dbo].[GetADGroupMembers]    Script Date: 2026-04-02 10:56:50 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



CREATE PROCEDURE [dbo].[GetADGroupMembers]
    (
     NVARCHAR(128)
    )
AS
BEGIN
DECLARE  NVARCHAR(max),  NVARCHAR(max)

SET  = '
    SELECT  = distinguishedName
    FROM OPENQUERY(ADSI, ''
        SELECT distinguishedName 
        FROM ''''LDAP://DC=###''''
        WHERE 
            objectClass = ''''group'''' AND
            sAMAccountName = ''''' +  + '''''
    '')
'

EXEC SP_EXECUTESQL , N'@Path NVARCHAR(max) OUTPUT',  =  OUTPUT 

SET  = '
SELECT  cn AS UserName, samAccountName, distinguishedName AS OU
FROM    OPENQUERY(ADSI, ''select cn, samAccountName, distinguishedName
from ''''LDAP://DC=###'''' 
where MemberOf =''''' +  + '''''''
)'

EXEC SP_EXECUTESQL 
END

GO

If anyone can help me making a TVF with that?

THank you!


r/SQL • • Apr 03 '26

Discussion If AI can do the technical work what’s the point of having technical interviews anymore ?

0 Upvotes

each year AI is getting better and layoffs are happening. In any tech heavy role, what’s the point of intense technical interviews if AI is basically going to be part of the workflow


r/SQL • • Apr 02 '26

MySQL MYSQL Question Help

1 Upvotes

I'm having an issue understanding what the right answer is.

The question is

Which data type will store "287,33" as a numeric value without loss of information?

  • BIT
  • INT
  • DECIMAL
  • VARCHAR

The quotes and the comma are throwing me off, thinking it's VARCHAR