r/SQL 5h ago

Discussion Looking for AI tools to make working on a new SQL project easier

1 Upvotes

Hey everyone,

I’m currently setting up a new project involving SQL and I’m looking for some AI tools that could help make the development process easier and more efficient.

I’m particularly interested in tools that can help with things like:

  • Writing and improving SQL queries
  • Designing database schemas
  • Debugging SQL errors
  • Generating or optimizing queries
  • Understanding existing databases/tables
  • Creating test data
  • Documentation
  • Connecting SQL databases with other development tools
  • Anything else that can save time during development

I know there are a lot of AI tools out there, but I’d rather hear from people who have actually used them in real projects.

What AI tools are you currently using for SQL/database work, and which ones have genuinely made your workflow easier?

Also interested in hearing about any tools you tried but wouldn't recommend, and why.

Thanks!


r/SQL 12h ago

Discussion At what point of time do you believe that you are ready to apply for SQL Jobs ?

14 Upvotes

Hands down, man, seriously!

At some point, after writing JOIN after JOIN, SUM, RANK, CTE, Subqueries, Window Functions, LAG, LEAD, WHERE vs HAVING, DATETIME, ORDER BY DESC...

There has to be a moment where you say:

“Alright bro… enough SQL gymnastics. Let’s actually use this thing.

So what’s that point? When do you believe that you can start applying it like a real analyst.


r/SQL 22h ago

Discussion When does a SQL query become “too clever”?

41 Upvotes

I’ve come across queries that are extremely compact and technically efficient, but difficult for someone else to understand or modify later.

For example, a query might use nested window functions, multiple conditional expressions, and several transformations to solve something that could also be written as a few simpler steps.

Where do you personally draw the line between elegant SQL and over-engineered SQL?

Do you prioritize fewer lines, query performance, or maintainability when these three goals conflict?


r/SQL 19h ago

Discussion Anyone using Lakebase with SQL heavy apps ?

2 Upvotes

How do u handle query performances when the same tables are being hit by both app queries and AI generated SQLs from any AI tools such as Codex, CLaude, Genie etc
Curious if you separate workloads or optimize at the query level.


r/SQL 16h ago

Discussion How do you check data quality and flag good/bad records?

2 Upvotes

For example, if a customer dataset has nulls, duplicates, invalid emails, or incorrect values, how do you identify and flag these records as good or bad? What tools or query approaches do you use?


r/SQL 16h ago

Discussion Any skills that you use for sql code review

2 Upvotes

I am a Ruby on Rails developer. I’m looking for some skills that can help me self code review for sql part. I use Claude. Like that can guide me not to write sql that are anti patterns etc


r/SQL 20h ago

MySQL how to standardize this date column in mysql?

10 Upvotes
ship_date delivery_date
Feb 10 2024 Feb 15 2024
2024-01-12 2024-01-11
2024-01-10 2024-01-14
01/15/2024 01/19/2024

r/SQL 15h ago

Discussion Built a small CLI tool to find/clean duplicate rows in MySQL & PostgreSQL, feedback welcome

2 Upvotes

been dealing with duplicate customer records in a project for uni and kept rewriting the same GROUP BY/HAVING query every time so i just built a cli tool for it in the end - works with both mysql and postgres, dry run by default so nothing gets deleted unless u explicitly pass --confirm and it backs up to json first just in case. still a student so the detection logic is prob missing some edge cases; that's the part i actually want feedback on tbh. happy to share the repo if anyone's curious, can drop the repo link


r/SQL 22h ago

Discussion Partitioning or indexing for spark sql?

9 Upvotes

Im working with some large tables in spark sql that has around 300 mil records and they are quite wide as well maybe around 80-90 columns.

We frequently have to perform filtering and aggregations for reporting purposes, I'm trying to understand when should I use partitioning and when should I use indexes.

For instance if I want to filter by date will it be better to partition by date or should I use an index on the date column, which one would help with performance?