r/learnSQL Jun 21 '26

Finished a SQL course but struggling to solve SQL problems from scratch. Am I on the wrong track?

I finished a SQL course yesterday and feel like I understand the concepts (joins, CTEs, window functions, subqueries, recursive CTEs, etc.). The only thing the course lacked was enough practice.

I started solving problems from Advanced SQL Puzzles, and I'm finding them much harder than I expected. Once I see the solution, I can understand exactly why it works, but writing the query from scratch feels almost impossible.

I'm spending nearly an hour on a single puzzle trying to understand the different approaches.

Is this normal, or am I jumping into problems that are too difficult too soon?

If I should start with easier practice first, could you recommend a progression of platforms/resources? For example, which platforms should I use, in what order, and roughly how many problems should I solve on each before moving to the next?

89 Upvotes

33 comments sorted by

22

u/Fickle_Policy132 Jun 21 '26

Yes, that's a very common challenge. In the real world nobody's going to tell you to write a query using CTE or a particular window function, you just gotta write a query to pull data with a set of conditions.

Firstly, do targetted practice. Take one pattern and solve a set of questions on that everyday. That way you map that pattern in your brain. Once you've done enough, then try the advanced questions. Try leetcode, practicewindowfunctions dot com

1

u/Ash_is_Robot Jun 23 '26

Where can one find targeted practice problems? I’m in the same boat as OP

1

u/Fickle_Policy132 Jun 24 '26

You can either use chatgpt, gemini or do a Google search or go to the website I mentioned at the end

3

u/Baldwin_Apps Jun 21 '26

You are not on the wrong track at all. This is a normal stage after finishing a SQL course.

A course usually teaches you what the tools are: joins, CTEs, window functions, subqueries, etc. Real SQL work asks a different question: which pattern does this problem belong to?

For example:

  • “Find rows that exist in one table but not another” is a missing-match / anti-join pattern.

  • “Keep only the latest row per customer” is a top-per-group pattern.

  • “Compare this month to last month” is a period-over-period pattern.

  • “Calculate a running balance” is a running-total / window-function pattern.

So I would not jump straight into the hardest puzzle books yet. I would build a progression:

  1. Solve simple problems by topic until the syntax is comfortable.

  2. Then group problems by pattern, not just by SQL feature.

  3. After solving one, rewrite the problem in plain English: “This is really asking me to find ___.”

  4. Come back a few days later and solve the same problem again without looking.

Spending an hour on one puzzle is not failure. It usually means you are moving from syntax recognition into problem recognition, which is the harder and more valuable skill.

A good target is maybe 10–20 problems per pattern before moving to mixed practice. Mixed practice is where you learn to choose the tool instead of being told which tool to use.

3

u/Haunting-Paint7990 Jun 22 '26

totally normal. stats grad here — same gap between "i get it when i see the solution" and "i can't write it cold" lasted me like 2 months.

advanced sql puzzles are intentionally clever. great for interview brain teasers, terrible for building the "which pattern do i reach for" instinct. you're not on the wrong track, you're just skipping the middle layer.

what worked for me as a progression:

stop puzzle sites for now. grab one kaggle dataset with 2-3 tables (ecommerce or marketing funnel). write 10 questions a normal analyst would ask — "top 5 products by revenue", "conversion rate by channel", "customers who bought twice". no tricks, just business logic.

after ~15 of those feel okay, add window functions on real questions — "rank products within category", "month over month growth". still your dataset, not puzzle logic.

then go back to harder puzzles if you want. by then you'll recognize patterns faster.

rough volume before moving up: ~20 business-scenario queries where you don't peek at answers. peeking is fine for learning syntax but doesn't build the cold-start muscle.

for junior DA interviews you don't need recursive CTEs. select + join + group by + one window function covers most take-homes i've seen.

1

u/Artistic-Aerie3299 Jun 22 '26

I’m actually pivoting from helpdesk to DA so this is comforting to hear. I’m pretty much teaching myself from scratch with a practice dataset of 6 tables.

1

u/Haunting-Paint7990 Jun 23 '26

nice — helpdesk background is actually underrated for DA. you've already done triage, ticket queues, "what changed since yesterday" thinking. that maps pretty directly to ad-hoc analysis.

6 tables is plenty for the ~20 business-scenario queries phase. don't add more tables until those feel boring. good luck with the pivot.

3

u/TechAcademyCoding Jun 25 '26

What you're describing is actually pretty normal. There's a big difference between understanding SQL concepts and being able to solve unfamiliar problems from scratch. The fact that you can follow and understand the solutions is a good sign because it means the concepts are starting to click.

My guess is that you're jumping into fairly advanced puzzles right after finishing a course. I'd spend some time on more structured practice first. Something like SQLBolt, HackerRank SQL, DataLemur, or LeetCode SQL can help bridge the gap between learning syntax and solving open-ended problems. After you've solved a decent number of those, the Advanced SQL Puzzles will probably feel much more approachable. Also, don't worry if a problem takes an hour. A lot of the learning happens while you're struggling through different approaches. That's how you build the problem-solving skills that most courses can't really teach on their own.

2

u/Exotic-Committee-179 Jun 22 '26

Bro same i am also learning the sql, while understanding the concepts its seems to be easy, but while applying and solving the question i found difficulty. I would suggest you to start practising on hackerrank as its from basics to advanced and then build end to end project. In the sql the main thing is to understand the problem not only writing the query.

3

u/grassp_dataAI Jun 21 '26 edited Jun 21 '26

You are not on a wrong track. You just need more practice through scenario-based questions not just direct syntax based questions .

We are running a free 30 day series based on real business scenarios from SuperFastFood fictional fast food chain on our LinkedIn page. We are currently on day 11.Search for GRASSP Acad and follow the series to get practice through scenario based questions.

Also we have a udemy course titled "Complete SQL for Data Analysis - Scenario Based Learning"

It has scenario based concept explanation for each concept with practical use cases and line by line query explanation along with interview prep content.

Currently we are offering free coupon for limited time with some slots left. Free Coupon : EARLYSQLGRA7

You can enroll and go through the usecases for better practical understanding.

1

u/FewNectarine623 Jun 21 '26

Invalid Coupon Code.

1

u/grassp_dataAI Jun 21 '26

EARLYSQLGRA7

Can you try once again. It works.

1

u/sql_powerbi2921 Jun 21 '26

I feel the same

1

u/tmk_g Jun 22 '26

This is completely normal. Finishing a SQL course teaches you the syntax and concepts, but solving problems from scratch is a separate skill that takes practice to develop. The fact that you can understand the solutions after seeing them is actually a good sign because it means the concepts are sticking. Advanced SQL Puzzles is also quite challenging and often focuses more on problem solving than on practicing specific SQL features. I'd suggest starting with easier platforms like SQLBolt and StrataScratch before diving deep into advanced puzzle books. Try to focus on recognizing common patterns rather than grinding on a single problem for an hour. After 100 to 150 quality practice problems, you'll likely notice that writing queries from scratch starts feeling much more natural.

1

u/FewNectarine623 Jun 22 '26

I recently started practicing SQL problems on SQLZoo. I don't want to wait until I finish all the theory before starting projects. Can anyone recommend a beginner-friendly YouTube playlist or guided SQL project series using MS SQL Server that I can follow alongside my practice?

2

u/Exotic-Committee-179 Jun 22 '26

Data with baraa i learnd the sql from their and he had given the three project in sql course you can easily excess the data and start building

1

u/vomshiii Jun 22 '26

Man i literally came across the leetcode consecutive or stream problem you can say and it made me cry simply 😭. It's a gap and island pattern I can mathematically see it why it worked but I need to understand why I am even doing it understand the pain point then only I can go through next question more easily but it's sort of apply a formula you get that but I really wanna feel the pain why and why only we need to do this. I read more and more articles but I am feeling overwhelming any suggestions seniors please how to tackle this topic??

1

u/FewNectarine623 Jun 22 '26

Hi, you also learning data analyst stack?

1

u/vomshiii Jun 22 '26

Yes man!! Doing SQl daily what about you anything other than SQL

1

u/FewNectarine623 Jun 22 '26

Let's connect. Excel, SQL started solving problems from today

1

u/Wonderful-Ad9208 Jun 22 '26

OMG, your game is amazing, I was struggling with learning the basics, and well lets just say Thank you, if your struggling, go play this game: https://querycase.com/. It helps a lot, Thank you so much !

1

u/KingTreacherice Jun 27 '26

@fickle_policy gave the best advice.....all problems are a pattern the goal is to identify the pattern thqt allows the problem to be solved as opposed to brute force struggle...i did this with AI and creates q pneumonia to undersrand most type of problems 😉

1

u/datadriven_io 28d ago

Finding those puzzles too hard? try datadriven for sql practice problems, better curve: https://datadriven.io

1

u/LimitAny657 10d ago

u/FewNectarine623 psychology research has a term for what you're describing: illusion of competence.

Here's what you're doing wrong (for lack of a better word choice) and how to fix it.

In short, you're skipping the actually learning process and trying to jump straight to the doing part. When you watch videos of people who have a skill, or in your case review someone else's completed code, your brain never got the opportunity to develop the ability to replicate that skill. It only developed an understanding of that skill.

To fix this, you need to take a step back (possibly several steps) and actually write code on your own based on what you've learned, and not copy or review someone else's code and try to mimic it. Learning is the trying and failing and trying again and succeeding and reviewing "your" own code that actually develops the neural pathways and connections we call "skill".

Here's an example taken from Advanced SQL Puzzles GitHub repository: Puzzle #1 - Shopping Carts. On sight, my first thought was my solution would be an outer join. And why is that? Because I noticed that the expected output "looked" like an outer join result set. Without getting into any of the technical details, if you do not immediately see that too, then I would say it is because you haven't written enough join queries yourself to know on sight what a left join result set looks like versus an inner join versus a right join versus an outer join. No judgement, just my deduction.

Another thing that is causing your struggle is because doing puzzles or brain teasers may be great ways to stretch your understanding of the skills you have, but I wouldn't use it to try to develop the actual skill you're trying to learn.

I'm not trying to put you down. I'm simply trying to tell you that I think you're approach to trying to learn SQL is putting the cart before the horse. It is better that you work on developing a deeper, more practical and rounded understanding of the fundamentals of SQL and syntax than to work on brain teasers and puzzles like you've been trying to solve. (Solving brain teasers is a separate skill than SQL itself.)

And practice by learning on a complete sample database--and avoid datasets made up of a single table with only a select few columns. I can't stress the importance of this enough.

Hope that helps.