r/SQL • • Mar 29 '26

Discussion Fully local SQL Canvas using DuckDB

7 Upvotes

Hi, I have been working on a local-first data canvas as a side project for over a year now:

There is an infinite canvas where each SQL query is a node that can reference other nodes using FROM node_employees() . It will then get refreshed automatically if its parent changes.

You can try it out here: https://app.dash.builders/. It either runs 100% locally in the browser via DuckDB-WASM, or as a DuckDB community extension, so you can query the nodes even from Python. Happy to get some feedback :)


r/SQL • • Mar 28 '26

MySQL What type of SQL skills do you use as a professional data engineering(or any role where you heavily use SQL skills) everyday? Were there new sql skills you learned on the job(like Subqueries, windowing and CTEs?)

29 Upvotes

I really like to know more insight into how advanced my SQL skillls have to be for the average professional data engineer?


r/SQL • • Mar 28 '26

Discussion Primary Key vs Primary Index (and Unique Constraint vs Unique Index). confused

9 Upvotes

Hey everyone,

I’m trying to properly understand this and I think I might be mixing concepts.

From what I understood:

  • A primary index is just an index, so it helps with faster lookups (like O(log n) with B-tree).
  • A primary key is a constraint, it ensures uniqueness and not null.

But then I read that when you create a primary key, the database automatically creates a primary index under the hood.

So now I’m confused:

  • Are primary key and primary index actually different things, or just two sides of the same implementation?
  • Does every database always create an index for a primary key?
  • When should you explicitly create a unique index instead of a unique constraint?

Thank you!


r/SQL • • Mar 28 '26

Discussion what is your job role? do you spend more time reading or writing sql code?

0 Upvotes

let me know


r/SQL • • Mar 27 '26

SQL Server Friday Feedback for Extended Events! ⚡

2 Upvotes

Hey folks! It's been a hot minute since I've posted, a few important things to share, and then a request.

  • GitHub Copilot in SSMS is now Generally Available in SSMS 22.4.1.

  • We released SSMS 22.4.1 last week and recommend folks update to the latest

    • New features include Group by Schema for all SQL databases
    • Additional export options including Excel (yes, you read that correctly), JSON, XML and markdown.
    • Release notes

Now, many of you know that I like Extended Events (XE) a lot. I've been on a mission for...years...to get folks to use XE instead of Profiler and Trace.

Today's post is *not* about that. 💁‍♀️

Today, I want to understand what XE or Profiler/Trace sessions you create most often. Bonus points if you share some insight into why you are using those sessions. EXTRA bonus points if you provide the T-SQL.

If you're curious, my reasons are two-fold.

1️⃣ Within SSMS we have XEvent Profiler (don't come at me for the name). We offer two sessions in there to make it easy for folks to get started. Maybe we should add more.

2️⃣ We're working on Agent Mode for GitHub Copilot in SSMS, and using copilot to help analyze XE data would be incredibly helpful. From my side, I want to make sure our initial efforts cover the data you're analyzing most often.

Thanks in advance to any of you that take time to respond here. It's been a great couple of weeks with feedback from SQLCon/FabCon and MVP Summit. Obviously, we're not done 🤗


r/SQL • • Mar 26 '26

MySQL What’s your process for validating data after ETL jobs?

24 Upvotes

Curious how others handle this —

After running a pipeline (like MySQL → BigQuery / Snowflake), how do you make sure the data is actually correct?

Do you rely on:

  • row count checks?
  • schema comparison?
  • custom scripts?

Or is there a better way?

Trying to understand real-world practices and pain points here.

Not promoting anything — just learning.


r/SQL • • Mar 26 '26

Discussion best text book for query optimization ?

15 Upvotes

I need a text book for query optimization


r/SQL • • Mar 27 '26

MySQL COBOL O SQL?

0 Upvotes

Buenos días, soy prácticamente novato en el tema.

Tengo la intención de complementar mi cv y aprender.. para porque no en un futuro encontrar alguna oportunidad superadora en lo laboral y economico.

Actualmente trabajo en una empresa del agro, en un puesto que tiene que ver con el uso de sap, excel, analis de cuentas, pagos etc.

Que me recomendarian? COBOL o SQL?


r/SQL • • Mar 26 '26

MySQL [Mission 014] The Schema Architect: Data Modeling Under Fire

Thumbnail reddit.com
0 Upvotes

r/SQL • • Mar 26 '26

Oracle What I learned about reporting in Oracle APEX after struggling with exports

5 Upvotes

I recently spent some time improving how I handle reporting in Oracle APEX, especially around readability and export issues.

One thing that stood out to me was that most of the problems I was facing were not really technical. They were more about how the reports were designed.

For example, I used to treat reports as just SQL output. Everything worked, but it wasn’t easy to read, and things got messy when trying to export to PDF or share with others.

Once I started focusing more on structure, grouping, and how the data is actually consumed, it made a big difference.

Curious how others are handling reporting in APEX, especially when it comes to clean exports or client-facing reports.


r/SQL • • Mar 26 '26

MySQL Relational Database PROJECT - TIPS

1 Upvotes

Hi, I have a school project where I need to create a relational database with 5 to 10 tables. Do you have any suggestions for where I could find suitable datasets that can be split into related tables and connected in a database?


r/SQL • • Mar 25 '26

Discussion When to use RIGHT JOIN instead of switching tables in Left Join

35 Upvotes

Hello all! I need some help with understanding the utility of Right join. I have 2 tables: Orders and Customers. If I write Orders RIGHT JOIN Customers it returns the same results as switching tables and using left join, like Customers LEFT JOIN Orders. But when these 2 examples can give different results? Like when it is mandatory to use right join instead of just switching tables in left join?


r/SQL • • Mar 25 '26

SQL Server Nested Stored Procedure Solution

11 Upvotes

I am attempting to set up a stored procedure that can be called in SSRS or with a short prebuilt query that loads the proc results to a temp table and can be worked from there, but a stored procedure is being called as part of the procedure I am trying to run and it's giving a "An INSERT EXEC statement cannot be nested" error. I don't know of a good way to solve for this other than taking the inner proc code and just pasting it wholesale to the outer proc code, so I'm hoping for some ideas on how to get around this.

The concept is to build a data set with a dynamic "As of" date the user can select. This is for claims data which is important because I am doing this at both a "Header" level (John Smith saw Dr Bill on 3/25/26 and the claim paid $100) and at a "Line" level (John Smith saw Dr Bill on 3/25/26 for a standard office visit that paid $80 and a flu shot for $20).

So my inner proc is compiling all of the claims data at a "Header" level as of whatever date the user selects and storing the results in a temp table I can refer back to. I need this in my outer proc code because the way our vendor has things setup is a nightmare. They don't have great set logic for making line level calculations so I was able to back into their results by doing a series of attempts to calculate "Line" level amounts, sum those up to a "Header" level, and then compare that result with my "Header" level results. The ones that match I hold as good, the ones that don't I keep trying different combinations of charge and adjustment codes until they do tie out to the "Header" level. After about 6 passes it all sorts out and matches.

So I need the header level proc to have the same "As of" date as the line and I need them both to be built on demand, but again I'm hitting a road block because I can't pass the results of one proc to the next.

Open to any ideas that may get around the nested proc issue while maintaining the dynamic build based on user selection.


r/SQL • • Mar 26 '26

MySQL Building a modern Database Managment tool. You can either use it as an app or deploy it on your server like PHPMyAdmin back in the day

2 Upvotes

r/SQL • • Mar 25 '26

Discussion Anyone else including their WHERE conditions in the JOIN conditions?

33 Upvotes

I really like to put where conditions, which belong to a table into the join condition. Basic example

from table
left join cte
  on cte.ID = table.ID
  and cte.rank = 1

Personally I find this more readable especially when I have a query involving multiple joins, because you don't have a big block of where conditions after a big block of joins and need to puzzle things together.

Obviously I do not put every condition in the join and I also do not put complex nested conditions in there.

I am just wondering if I am the only who feels that this way is more logical. As far as I am aware the result of the query should be the same.