r/learnSQL • u/Sea_Butterfly713 • Jun 05 '26
how do you guys became proficient in SQL???
i have completed sql on stratascratch but i cant write the query from scratch.
im strugling with logic , when to use which function and all , im practicing on sakila database on sql server . whatever i learn i ask chatgpt to give me 10 question from that topic then i write the query and give it back to chatgpt to review . so the question is what im doing wrong and how can i improve?????
69
Upvotes
26
u/DataCamp Jun 05 '26
This gap usually comes from how the practice is structured. When ChatGPT gives you 10 questions on a specific topic, you already know roughly which function applies before you write a single line. Real problems don't give you that hint.
Try flipping it: start from a business question instead of a function. Pick something from Sakila, like "which customers haven't rented anything in the last 90 days?" or "what's the average revenue per store by month?", and figure out the SQL yourself before asking for any help. That's the actual hard part: translating a question into a data shape. Syntax you can look up; logic you have to build.
Also worth trying: take a query you wrote, delete it, and rewrite it the next day without looking. If you can't, you understood the answer but not the reasoning. That's the thing to fix.
4
u/Ginger-Dumpling Jun 05 '26
Get some datasets where you understand the underlying data (ideally something that interests you), decide what kind of results you want to produce from it, work out how you'd go about getting it.
3
u/LookAtYourEyes Jun 05 '26
Practice on data sets
3
u/ejpusa Jun 05 '26
Decades at it. Back to IBM DB2 days.
Now, I just let GPT-5.5 and Claude handle it all. The code is pretty much unreadable, rock solid, and just awesome.
But that’s me.
Suggest GPT-5.5 build a semester class for you. It’s great at that.
2
u/Tiktoktoker Jun 05 '26
Hands on practice for years and years.
2
u/QueryCase Jun 07 '26 edited Jun 07 '26
One thing that helped me was realising that writing SQL isn't really about remembering functions, it's about learning to break a question down into smaller questions.
For example, if someone asks:
Before writing any SQL, I'd ask myself:
Once you answer those questions, the SQL almost writes itself.
A lot of practice platforms accidentally give away the solution because the topic is obvious ("write a GROUP BY query", "use a JOIN", etc.). Real-world SQL is usually the opposite: you have a business question and need to figure out what SQL concepts are required to answer it.
So I'd spend less time memorising functions and more time practising the process of turning a question into a series of smaller steps.
2
u/Puzzleheaded-Meat144 Jun 07 '26
You’ll become proficient when you know what queries are needed to get the output you want. This doesn’t mean you’ll know the syntax, becoming proficient in SQL = knowing your data that’s my personal opinion.
2
u/MikeyMicky Jun 09 '26
are you learning querying only, or also DDL and DML?
1
u/Monkey_Socrates Jun 05 '26
I feel like I post this every day, but use duckdb UI mode to practice queries on kaggle datasets. Been super helpful at work lately
1
u/Flimsy-Description60 Jun 09 '26
If you’re focussing on SQL, don’t just do Leetcode blindly.
Start with
-Joins (most important)
-Window function ( most asked)
Also try solving real world questions instead of just patterns
Happy to guide if needed 😊
3
u/Eleventhousand Jun 05 '26
2
u/Flying_Saucer_Attack Jun 05 '26
just by using it every day lol
1
u/Comprehensive-Tea-69 Jun 06 '26
Desperate necessity at work. Need the data today or tomorrow to do the research, have to figure it out quickly.
1
u/footymcfoot9 Jun 08 '26
learndataready.byconol.com is good for starters doesnt have DML and DDL just purely SQL though.
Im the creator and i built it for aspiring data analysts
1
u/tkroy69 Jun 10 '26
One of the qays that worked for me is going through a whole lot numbers of use cases. By use cases by i mean , after i take a new dataset and start asking business questions that either seem complex like would require cte or window functions or case statements or joins , i keep a document of codes just for that dataset. I even ask chatgpt to ask questions based on levels beginners , intermediate and advanced, and once i almost exhaust every possible question that can be asked from that dataset i move to some other dataset. This way i have built a memory of questions. Sometimes i use relevance of questions to remember, sometimes relevance of reasoning to figure the solution out , and if I can't remember i have my handmade docs to refer to ( which i keep revising everyday while i am on that particular dataset and once in a while when i have move on) or just ask chatgpt.
31
u/[deleted] Jun 05 '26
[removed] — view removed comment
2
u/[deleted] Jun 05 '26
[removed] — view removed comment
2
u/[deleted] Jun 07 '26
[removed] — view removed comment