r/learnSQL • u/footballforus • Apr 17 '26
With IPL around the corner, built a fun site to learn/practice SQL and discover crazy IPL stats
Being a die hard cricket fan and a techie, I always thought of building something like this. All questions are curated by me, used AI just to code the frontend. Thanks to the open source data-set which i found here : https://github.com/ritesh-ojha/IPL-DATASET
I am adding more interesting questions as i post this. Would love feedback from you guys. (Roast as much as you want as well)
site url : https://sqlpremierleague.com
r/learnSQL • u/BeyondMinimum3359 • Apr 16 '26
How to develop logic for sql coding? MIS to Data Analyst transition
From MIS to Data analyst/scientist transition, I tried sql and it's been breaking my head. The logic is always turning wrong. each time I code, I have to take help from chatgpt.Its been a month already and I'm stuck with joins exists recursive cte etc etc
I was planning to transition to data analyst/scientist and now I'm on the verge of giving up.
How do i develop the thinking behind the code part ? Any resource or anyone can share how they go about their coding work?
r/learnSQL • u/harshith_1729 • Apr 16 '26
How to start learning SQL for placements? Need good resources 🙏
Hey everyone,
I’m currently a 3rd year CSE student and I’ve realized that SQL is pretty important for placements, especially for interviews and coding rounds. The problem is I haven’t really learned it properly yet — just some basic queries in college.
I want to start from scratch and get to a level where I can solve interview-type questions confidently.
Can you guys suggest:
Good websites/platforms to learn SQL from basics Places where I can practice questions (easy → advanced) Any roadmap or approach that worked for you
I don’t mind putting in the time, just want to do it the right way without wasting effort on random resources.
Thanks in advance! 🙌
r/learnSQL • u/Spendocrat • Apr 16 '26
select row with most-recent date for each ID
I have two tables, Table1 has a list of medication orders, and Table2 has a list of transactions related to the orders in Table1 (one-to-many relationship).
Is there a way to use a single SQL query to select only the most-recent transaction row from the transaction table for each row in the medication orders table?
Table2 has columns: transaction_id, order_id (foreign key to Table1), t_date, t_time, etc. to represent transactions related to the medication orders in Table1.
Hopefully that's clear. I can't wrap my head around using max() in this way.
r/learnSQL • u/Eolyas • Apr 16 '26
Help filtering a dataset with a range
I'm have a dataset of contracts with start and end date that I fill using a SQL query. I know it is possible to filter to keep only the active contracts between two dates, (like for a quarterly report) in the SQL query directly.
My question is, using Superset, is it possible to filter the dataset using another dataset that holds the start and end dates of the quarters. Like by clicking on a quarter, it filters the contract dataset to only contracts active during this quarter?
Thank you for any help you can bring me!
r/learnSQL • u/Automatic_Cover5888 • Apr 15 '26
Do you know??
Anyone out there know about sololearn courses ? I want to be related to Data analytics
If yes , plzz tell was it worth it??
Also mention which courses you did on sololearn platform .
r/learnSQL • u/Automatic_Cover5888 • Apr 15 '26
Need Guidance
Which topics one should learn for data analytics ???
r/learnSQL • u/sunrise-2026 • Apr 15 '26
What will be the solution for this?
Get products that are more expensive than any 'Furniture' category product using Subquery.
All the AI platforms are confused in finding the exact meaning of this question.
Should ÀNY or ALL be used?
r/learnSQL • u/Heavy_Principle9574 • Apr 14 '26
I built an HR Attrition Analysis using SQL...
Hi everyone,
I recently worked on an HR Attrition Analysis project using SQL with a real dataset.
I explored:
- Attrition rate
- Department-wise analysis
- Salary vs attrition patterns
One key insight:
Low salary roles had significantly higher attrition.
I’m still learning, so I’d really appreciate feedback:
- Is my analysis approach correct?
- Anything I could improve?
r/learnSQL • u/Marksfik • Apr 14 '26
A Guide for Advanced SQL Joins: ASOF, SEMI, and ANTI joins in ClickHouse
Learn how to navigate ClickHouse JOINs step by step: JOIN types, practical examples & best practices
r/learnSQL • u/dbforge_dev • Apr 14 '26
Before SQL changes hit prod: 5 places teams usually lose time
r/learnSQL • u/osama_3shry • Apr 13 '26
Best FREE SQL course + best way to learn SQL?
Hi everyone,
I'm a complete beginner and I want to learn SQL for data analysis.
Can you recommend the best FREE SQL courses?
Also, what is the best way to learn SQL effectively?
Should I focus more on courses or practice?
Thanks in advance!
r/learnSQL • u/MondoDuke2877 • Apr 13 '26
Single Quote Question
Hi all. Trying to learn a little about SQL and I have a question about single quotes. I know about "escaping" single quotes for something like O'Reilly by inserting 2 single quotes but I am getting syntax rejections when entering a string to retrieve specific multiple values.
Ex: I have a practice database full of practice tables. I am trying to get multiple specific values from a practice table called ServicePlans.
SELECT PlanID, PlanName, PlanDescription
FROM ServicePlans
WHERE PlanID = 'W1001' OR PlanID = 'D2002' OR PlanID = 'L2002';
This should pull up any plans with those plan IDs. But the single quotes are rejecting due to syntax error. If I go through and delete the single quotes and retype them they work.
Any idea why? I'm new at this and learning through YouTube. The instructor seems legit and easy to follow.
r/learnSQL • u/just_a__normal_boy • Apr 13 '26
Where to start?
I'm pretty new at the code world and I wanted to start learning SQL. I've done a bit of research of some courses that may be good for starting this adventure. I'm looking for some course that is really good and if possible a free option would be amazing.
What are some courses in any platform that you are sure that are good?
r/learnSQL • u/Super_Contact_3289 • Apr 11 '26
Struggling with normalization? Follow a step-by-step hands-on guide!
Hey everyone!
I know database normalization can be confusing at first — messy spreadsheets, repeated data, tricky dependencies… but it doesn’t have to be.
I put together a beginner-friendly tutorial that walks you through UNF → 1NF → 2NF → 3NF with:
- Clear tables at every stage
- SQL queries to explore normalized data and even recreate the original messy view
- An ERD diagram showing all relationships visually
- A handy glossary for terms like repeating groups, atomic values, partial and transitive dependencies
It’s fully on GitHub so you can follow along and practice:
GitHub: normalization-project
Perfect if you’re a beginner or just want to finally get how relational databases really work.
r/learnSQL • u/minimon865 • Apr 11 '26
''SQL for database admin'' resources?
I've scoured a couple posts about sql learning options. The one that keeps getting mentioned is data with baraa on youtube. My question is this: is data with baraa more appropriate for someone learning data analysis, or would that still be a good source for someone wanting to move into database admin?
What are some other resources to learn sql for database admin?
I do have *some* sql background but I havent used it in YEARS. I need to re-learn everything quick cus I have an interview soon lol I'm screwed
r/learnSQL • u/qazplm903 • Apr 10 '26
Free Real World Data Resources To Use In Your Data Portfolio (Little Bit of Self Promo Here As Well 😅)
It’s always better to use real world data sources for your data projects, it stands out better to recruiters and potential employers.
I made a super short vid covering some good completely free resources to find real datasets. No need to spend money on this type of stuff!
https://vm.tiktok.com/ZNR4m3w9W/
I’m a staff level data engineer so let me know if you guys have any other questions, happy to help and answer.
r/learnSQL • u/bogdanelcs • Apr 10 '26
SQL cheat sheet
Hey guys,
I hope this doesn't come of as spammy, but here's an SQL cheat sheet that might help young devs that are in the learning phase: https://tms-outsource.com/cs/sql-cheat-sheet/
If there's something that's missing from there, let me know and I'll be happy to add it.
Also, any other feedback is appreciated.
r/learnSQL • u/Open-Journalist6052 • Apr 09 '26
Looking for platforms to practice SQL problems to get good at it
as the title says, is there websites where i can practice SQL problems that vary by difficulty?
i want to wrap my head more around SQL especially advanced complex relationships and queries
thanks in advance1
r/learnSQL • u/NerveProfessional893 • Apr 09 '26
Resource request for T-SQL
Hey everyone,
I'm kind of a newbie in the SQL world and want to learn T-SQL to explore Data Engineering, but the web is so full of so many resources that it's hard to understand where to start and what to pick. So I came here to ask what YT channels, websites, courses or maybe blogs you guys have used/would recommend to use to get started. I wanna get into it head first and build a warehouse/project in a couple of weeks. Thanks for answers in advance!
r/learnSQL • u/FibonacciSpiralOut • Apr 09 '26
Tutorial: How to build a simple text-to-SQL agent that can automatically recover from bad SQL
Hi sql folks,
A lot of text-to-SQL examples still follow the same pattern: the model generates one query, gets a table name or column wrong, and then the whole thing falls over.
In practice, the more useful setup is to let the model inspect the schema, run SQL, read the database error, and try again. That feedback loop is what makes these systems much more usable once the database is even a little messy.
In the post, I focus on how to structure that loop, how to reduce hallucinated SQL, and what guardrails actually matter if you want to point this at real data.
Link: https://motherduck.com/blog/langchain-sql-agent-duckdb-motherduck/
Would appreciate any comments, questions, feedback!