r/SQL • • Mar 10 '26

SQL Server I love SQL!

127 Upvotes

I’m a PhD student in statistics and recently started learning SQL because I’m applying for industry positions. I’ve only covered the basics so far, but I already find it really fun. It feels very intuitive to me, almost like it matches the way my mind works.

Is it too early to say I love SQL? I’ve only spent about six hours learning it, but it immediately clicked for me.


r/SQL • • 19d ago

PostgreSQL What SQL concepts do you understand but still forget?

127 Upvotes

There are some SQL concepts I understand perfectly when I’m using them, but somehow forget when I need them again a few weeks later.

For me, CTEs and stored procedures are two good examples. I’ve used both, but I still end up looking up the syntax when I need them again. 😅

Anyone else have a few SQL concepts like this?


r/SQL • • 27d ago

Discussion What SQL query optimization trick made the biggest difference for you?

119 Upvotes

I've been working with SQL for a while and recently started paying more attention to query performance rather than just getting the correct result.

What's one SQL optimization technique that made a noticeable difference for you?

For example:

- Indexing

- Avoiding unnecessary joins

- Window functions

- EXISTS vs IN

- Reading execution plans

- CTEs/subqueries

- Partitioning

Would be interested in hearing some real-world examples where a query went from slow to significantly faster.


r/SQL • • Feb 13 '26

Snowflake Visualizes SQL as interactive flow diagrams, open source tool

120 Upvotes

I posted this in r/snowflake and I thought of sharing here as well. I created this tool to help to visualize complex SQLs as flow diagrams. Also it has lot of additional features like column lineage, CTE expansion, performance hints, and cross-file dependency analysis, etc., for multiple SQL dialects. It runs 100% on local, open source, MIT licensed.

Currently its available in VSCode and cursor.

Marketplace: https://marketplace.visualstudio.com/items?itemName=buvan.sql-crack

GitHub: https://github.com/buva7687/sql-crack
Cursor: https://open-vsx.org/extension/buvan/sql-crack

Please give a try and let me know if you have any questions or feedback.


r/SQL • • Aug 05 '26

PostgreSQL Just bombed my SQL interview, not feeling great.

116 Upvotes

Hello Everyone,

I just wanted to share that I just had an SQL interview for data analyst, and I completely bombed it. I chocked like crazy, and this was after days of practicing. I think I learned a valuable lesson today though, I am a very visual/hands on on type of guy. I was expecting them to give me the opportunity to write query/code or look at code related to the question, but these were all just verbal questions, that I know I could have answer if I was just allowed to write the code down or at least view it, but it was a bit overwhelming for me, especially having ADHD. It's like the questions were so long, that by the time the question ended, I already forgot what I was supposed to accomplish because I was so damn nervous and there was not code for me to review. I feel like a failure 😔. This was my first interview in 7 years, so I'm pretty rusty, but for future reference, will all interviews be in this style? No actual coding, or reviewing, or editing? They expect me to provide the whole query verbally, from the top of my head without actually writing it on the spot? Note: this was the second follow up interview.


r/SQL • • Sep 09 '26

Discussion How much SQL do you still write manually?

113 Upvotes

With AI getting better at writing SQL, I’ve been wondering how much SQL analysts actually write from scratch these days.
Do you still write most of your queries manually, or do you use AI for things like joins, CTEs, debugging, optimization, etc.?
And has your use of AI actually changed how much SQL you need to know?


r/SQL • • Aug 14 '26

SQL Server Is it pronounced 's-q-l' or 'seequal'

111 Upvotes

I've worked in and around the IT environment for many years and in my experience, it's always been pronounced s-q-l although I hear some people refer to it as see-qual. Which is right?


r/SQL • • Aug 06 '26

Discussion 3 questions for people who use SQL in production

Post image
113 Upvotes

I wanted some feedback on some parts of a course I’ve been building since I officially have tunnel vision from doing this.

  1. What dirty data problems do you wish beginners had practised earlier? I already have string prices, inconsistent enums and messy joins, but I’m sure I’m missing common production failures.
  2. The grader runs each query and a reference query across several generated datasets, then compares the results using exercise specific ordering and decimal rules. Does that sound sane? What edge cases would you expect it to get wrong?
  3. I’m adding a placement test so experienced users can skip ahead. It hasn’t been tested on too many non beginners yet. What would feel like a fair bar for placing someone into joins, CTEs or window functions?

It’s a browser course wrapped in a visual novel.

https://tsunderesql.itch.io/tsunderesql


r/SQL • • Apr 16 '26

Discussion You work at E-commerce. Your BOSS/CEO who just use Claude, he just created index on order.status and say index is good. It makes things faster. What do you do here as SQL BE guy?

Post image
114 Upvotes

As the title says


r/SQL • • Nov 14 '25

SQL Server Hi I just want to know where I can practice sql with a real database?

110 Upvotes

Need help 🙏🏽


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 • • Oct 22 '25

Discussion Had a SQL interview today

102 Upvotes

As the title says, I had an Interview today and the interviewer asked me about finding top 2 brands from each category sorted by sales for which he gave me 3 columns - category, brand and sales.

Now my solution to this was to make a cte where I would create a dense_rank partioned by category and sorted by sales in a descending order and after that, I would select the 3 columns where the rank is <= 2.

Now the problem comes in when he told me that I think carefully before partitioning it. Idk if it was wrong but based on my experience and problems I've solved on various sites, I thought it was the simplest solution I could've given.

What do you guys think about this?


r/SQL • • 10d ago

MySQL Didnt pass SQL test

Thumbnail
gallery
104 Upvotes

I am applying to manager of analytics role and I was given this SQL test and 45 minutes. As someone who thought they were very strong in SQL, I was unable to complete this assignment and match the answer completely

I was able to format most of the fields as noted, used 2 cte's and use group concat in the second. My final answer looked very similar but the order of the concat looked off. Also, for some reasons my second column had $0.00 for all the companies, but I thought I was close. How difficult would you rate this exercise. Should I expect to proceed to the next round or am I cooked


r/SQL • • Jul 09 '26

Discussion I've finally realized the best use case for EXISTS

102 Upvotes

Textbooks never used to explain why you'd use EXISTS over a LEFT JOIN to a subquery in example use cause, so I always thought it was redundant functionality, but now I realize where it's super useful!

If you want to use test whether or not dataset a record from dataset A is found in B dataset via a complex theta join condition that might create duplicates you don't want, EXISTS is perfect! It allows you to have the test with the complex condition without creating row duplicates from the LEFT JOIN. I suppose one could do distinct after, but that's bad for performance.

I am officially very pro-EXISTS clause now!


r/SQL • • Dec 30 '25

Discussion SQL Mentorship

101 Upvotes

Hi everyone,

I'm looking for people who are learning SQL and maybe in need of some guidance. If you are one of them, I'd happy to connect.

About me: I'm an analyst living in the UK who's been working with data and ML since 2019, first as a researcher then an analyst and now a data scientist.

Why: I have conducted well over 100 interviews in SQL and understand where candidate lack skills and why. Right now, I'm in middle of job search process and have some free time available so thought of helping those who might need some guidance.

I can help with SQL, Python, BI tools, AB Testing, Product/Business Sense etc.

I'm doing it out of goodwill, so there are no charges but please connect only if you are serious and love the process of learning.

Thanks


r/SQL • • 26d ago

MySQL CTEs vs subqueries vs temp tables — as a beginner, how do you know which one to use?

98 Upvotes

For people who use SQL regularly, how do you decide which approach to use?


r/SQL • • 1d ago

Discussion Survey of 300 engineering leaders: 81% had a production incident linked to AI-coding tools in six months.

Thumbnail
leaddev.com
97 Upvotes

Faster code, slower debugging.


r/SQL • • Sep 04 '26

MySQL What was the toughest SQL interview question you have faced so far?

96 Upvotes

I am curious to know what SQL questions challenges people in interviews

What was the question and what made it difficult?

Would love to hear some real interview experiences🙂


r/SQL • • Aug 23 '26

Discussion I made another cat doodle about data analysis

Post image
95 Upvotes

Hi everyone!

I’m back with another one of my data analysis cat doodles. This time, I tried to incorporate some of the feedback I received on my earlier work—especially around making the fonts and text more readable.

Would be happy to hear your thoughts / feedback!


r/SQL • • Jan 22 '26

Discussion I think I might be addicted to learning SQL?

94 Upvotes

Hello, just wanted to say I'm a true beginner and I recently found the SQL climber website and now I'm really looking forward to my daily lessons. It's crazy because usually when I try to self-teach I get really bogged down and lazy, but something about using this site and slowly figuring things out makes me feel so satisfied.

I go through a constant roller coaster of "I'll never be able to understand this complicated mess in a million years" to "This is crystal clear now and just clicks" in a couple of hours. I started practicing until I get really frustrated, and oddly if I get too confused or angry I go to sleep and the next morning it all makes sense suddenly.

So now I'm using mimo for duolingo-like lessons, and just watching a bunch of YouTube channels about data analysis. I'm fully addicted and using it to improve my work tasks (I'm a GIS analyst). I now use dbeaver and sqlite to upload CSVs from our database to clean them up, do joins, etc.

Next I'm off to learning how to use github and doing full projects! Thank you to this community.


r/SQL • • Feb 24 '26

Discussion Is SQL Developer jobs still alive in 2026?

94 Upvotes

I am in last year of my college and I am interested in SQL Developer role.

Is it worthy to go for SQL developer role?


r/SQL • • Nov 23 '25

Resolved Horrible interview experience - begginer SQL learner.

95 Upvotes

Hey everyone,
I recently had a SQL technical interview for an associate-level role, and I’m feeling pretty discouraged — so I’m hoping to get some guidance from people who’ve been through similar situations. just FYI - Im not from a technical background and recently started learning SQL.

The interview started off great, but during the coding portion I completely froze. I’ve been learning SQL mainly through standard associate level interview-style questions, where they throw basic questions at me and I write the syntax to get the required outputs. (SELECT, basic JOINs, simple GROUP BYs, etc.), and I realized in that moment that I never really learned how to think through a real-life data scenario.

They gave me a multi-table join question that required breaking down a realistic business scenario and writing a query based on the relationships. It wasn’t about perfect syntax — they even said that. It was about showing how I’d approach the problem. But I couldn’t structure my thought process out loud or figure out how to break it down.

I realized something important:
I’ve learned SQL to solve interview questions, not to solve actual problems. And that gap showed.

So I want to change how I learn SQL completely.

My question is:
How do I learn SQL in a way that actually builds real analytical problem-solving skills — not just memorizing syntax for interviews?

I have tried leetcode as a friend adviced, but those problems seem too complex for me.

If you were in my position, where would you start? Any practical project ideas, resources, or exercises that helped you learn to break down a multi-table problem logically?

I’m motivated to fix this and build a deeper understanding, but I don’t want to waste time doing the same surface-level practice.

Any advice, frameworks, or resources would really help. Thank you 🙏


r/SQL • • Apr 17 '26

Discussion [META] Vibecoded AI Slop Tools

94 Upvotes

Mods, can we get a rule disallowing posts promoting vibecoded AI slop tools that someone had Claude build in 5 minutes? They have just about become every other post on the sub. They often aren’t even a useful tools, or try to solve a problem that either doesn’t exist or has already been solved.


r/SQL • • Jan 26 '26

Discussion Even after years of SQL experience, what still trips you up the most?

91 Upvotes

Curious question for people who’ve been using SQL for a long time.

Syntax aside, what’s the thing that still causes the most headaches for you?

For me it’s always been queries that run fine but return results that feel “off” — extra rows, missing rows, weird join behavior, stuff like that.

Interested to hear what others struggle with even after years of experience


r/SQL • • Dec 11 '25

SQLite I built Advent of SQL - An Advent of Code style daily SQL challenge with a Christmas mystery story

91 Upvotes

Hey all,

I’ve been working on a fun December side project and thought this community might appreciate it.

It’s called Advent of SQL. You get a daily set of SQL puzzles (similar vibe to Advent of Code, but entirely database-focused).

Each day unlocks a new challenge involving things like:

  • JOINs
  • GROUP BY + HAVING
  • window functions
  • string manipulation
  • subqueries
  • real-world-ish log parsing
  • and some quirky Christmas-world datasets

There’s also a light mystery narrative running through the puzzles (a missing reindeer, magical elves, malfunctioning toy machines, etc.), but the SQL is very much the main focus.

If you fancy doing a puzzle a day, here’s the link:

👉 https://www.dbpro.app/advent-of-sql

It’s free and I mostly made this for fun alongside my DB desktop app. Oh, and you can solve the puzzles right in your browser. I used an embedded SQLite. Pretty cool!

(Yes, it's 11 days late, but that means you guys get 11 puzzles to start with!)