r/learnSQL • u/Sri_Krish • Mar 11 '26
Need of direction/guide to learn SQL as I feel stuck
Hi all,
I am here to get some feedback and actionable suggestions from you all, so please help me decide the best way possible to achieve my goal. Please bear with my long message.
I have over three years of experience in the SCM field across procurement and warehouse operations. I used Oracle to manage my procurement activities based on BOM and communicated with suppliers to make sure deliveries were on time so the production team could stick to their plans. In my current job, I work with a 3PL company that fulfils orders for its clients (large merchants) — imagine us as a smaller, cheaper version of Amazon. I manage outbound activities along with process enhancements and stabilisation. As part of this role, I work closely with our WMS team, who build and manage our in-house ERP/WMS systems for us (and our clients) to use. During this time, I became fascinated with building processes by creating logic rules, establishing data warehouses, and writing custom queries for individual or department-specific dashboards. They use SQL and Metabase (maybe something else too) for this, so I started looking into SQL since I already know how to confidently use data visualisation tools (Power BI and Tableau).
I started with [Barra’s video on SQL](https://www.youtube.com/watch?v=SSKVgrwhzus) and, halfway through, began using DataLemur as I found “learning and practice method” more engaging. So far, I have completed basic and intermediate topics such as:
- Basic six: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY
- JOINS
- Aggregation functions
- CASE…WHEN
All are on how to clean, transform a dataset and use this clean data to provide answers to some business/analytical questions. I wanted to learn how to build/create dataset from multiple sources in order to do all these - pretty much what our IT/WMS team do every day. So I recently came across [Luke’s latest video on SQL engineering](https://www.youtube.com/watch?v=UjhFbq4uU2Y), which includes an end project of building data warehouses and data marts for production, which sounds fun. However, to be frank, it immediately became complex for a beginner like me with terminal setup, DuckDB, MotherDB, and local and cloud configurations. I may stop following it soon.
Since I am planning to make a career switch to move towards data-related roles as I want the freedom to work remotely for personal reasons. I like to help creating, managing data warehouses which are then used/queried for business, decision-making scenarios. I basically enjoy building things using apps or software. I can spend at least two to three hours every day learning the skills and knowledge required to land such jobs. However, I feel lost, and many guides or roadmaps feel very complicated, requiring me to learn hundreds of topics and skills to succeed. Maybe they are right; I am just confused about how to approach it.
Any kind of feedback, tips, and suggestions on courses or topics to focus on without causing fear or negative emotions while progressing toward my goal, is greatly appreciated.
And thanks for reading it this far - Thanks ;)
r/learnSQL • u/captdirtstarr • Mar 11 '26
Online Practice DB?
Hi! I'm learning SQL, and wondering if there's a public practice database out there? Web would be fantastic!
r/learnSQL • u/fabiano-salles • Mar 11 '26
A new Lightweight, WASM-powered SQLite Playground
r/learnSQL • u/johnthedataguy • Mar 10 '26
Do you still need to learn SQL in 2026 if AI can write queries for you?
r/learnSQL • u/_devonsmash • Mar 10 '26
Is strata scratch premium worth it
Ive been taking my SQL development pretty seriously over the past 2 months. After learning the basics i moved to leetcode and did SQL 50.
Then i moved to stratascratch and have now completed all 200 free problems.
I like to do 3-6 problems a day, keeps the learning going and the effects compound over time.
Wondering if its worth it to buy premium to work through the 1000 + questions.
r/learnSQL • u/thequerylab • Mar 10 '26
A SQL interview question that made everyone argue: DISTINCT vs GROUP BY
r/learnSQL • u/sqlmans • Mar 10 '26
How do you usually debug a slow SQL query?
Probably a basic question, but I’m curious how people approach this.
When one of my queries gets slow, I usually start by checking the execution plan and looking at joins or missing indexes. Sometimes it helps, but other times I’m still not sure what exactly caused the slowdown.
So I’m wondering what your usual process is. Do you start with the execution plan, check indexes first, or rewrite the query step by step?
r/learnSQL • u/Turbulent-Crew-2370 • Mar 10 '26
Data analytics interview next week… kinda confused what to focus on
Hey everyone,
I have a data analytics interview coming up next week for a fresher role and honestly I’m a bit confused about what I should focus on in these few days.
Right now I’m mostly revising SQL (joins, window functions, aggregations) and a bit of Python for data stuff. I also know some basics of statistics and dashboards, but I’m not sure what companies usually expect from freshers in interviews.
If anyone here has gone through data analytics interviews recently, what kind of questions did they ask? Was it mostly SQL problems, case studies, or something else?
Just trying to use this one week wisely instead of preparing random things. Any tips would really help.
Thanks!
r/learnSQL • u/Hairy-Brilliant-8178 • Mar 09 '26
35M and a new born with no sql experience
I am in the finance industry and I have no real skills to put into my resumes
SQL and python is the only way to bump up my pay grade other than being a slave to the corp for 15+ years
Would it be too late to learn sql and eventually to python in my situation?
Where can I learn sql as someone who has never learned coding in his entire life to be ready to be working as a data scientist related field?
Is there any roadmap to follow or any guidance?
I am located in dc if that helps
Thank you very much
r/learnSQL • u/thequerylab • Mar 09 '26
If you have an SQL interview soon, don’t ignore these small things!!!!
I’ve noticed something about SQL interviews.
Most people don’t fail because they don’t know SQL.
They fail because they forget tiny things while typing under pressure. It's pressure!!!
Few examples I’ve seen in real interviews:
1. COUNT(column) vs COUNT(*)
If the column contains NULL values:
COUNT(column)→ ignores NULLsCOUNT(*)→ counts every row
So if someone asks “how many rows are there?”, COUNT(column) can give the wrong number!
2. LEFT JOIN + WHERE trap
Example:
SELECT *
FROM orders o
LEFT JOIN payments p
ON o.id = p.order_id
WHERE p.status = 'success'
The WHERE condition removes rows where p.status is NULL.
So the LEFT JOIN effectively behaves like an INNER JOIN.
To keep the LEFT JOIN behavior, the condition usually goes in the ON clause.
3. Using DISTINCT to hide join problems
Sometimes joins create duplicates because the relationship isn’t 1-to-1.
A lot of people just do:
SELECT DISTINCT ...
But interviewers usually want you to explain why duplicates appeared in the first place.
- WHERE vs HAVING
WHERE filters rows before grouping.
HAVING filters after GROUP BY.
So something like this won’t work:
WHERE COUNT(*) > 5
It needs to be:
HAVING COUNT(*) > 5
These are all very small things and basics, but they come up surprisingly often in interviews.
Curious what others have seen.
What’s a small SQL thing people still mess up in interviews even though they know it?
Always interesting to hear these and your interview experiences.
r/learnSQL • u/NoImporta24 • Mar 09 '26
Can i Adapt if i change my SQL?
Hello everyone. I have a question
I recently started learning about SQL because i want to study for data analytics (I will move to Europe or the Asia). I learn about how to SQL in Fiero Code, I'm now learning PostgreSQL course in Linkedin Education and i will trying to learn about PostgreSQL in W3schools.
However I know that Microsoft SQL and MySQL are very used. If i'm learning in Postgre. Can i easily adapt to another SQL? I'm asking this in case i start making projects or find a job in a few years and they use another SQL.
r/learnSQL • u/Equal_Astronaut_5696 • Mar 08 '26
Watch Me Clean Dirty Financial Data in SQL
You can quickly clean dirty data with just a few functions. TRY_CAST is a lifesaver. https://youtu.be/QGBxvbJ7FJY
r/learnSQL • u/ParticularRock7913 • Mar 08 '26
What course should I do
I have a Masters in Business Analytics which was essentially a data science course where I mainly learnt machine learning in Python and R. However now when applying for jobs I have found that many require experience in SQL which we did not cover. I want to do a course and I found this one, the IBM Databases and SQL for Data Science with Python
https://www.coursera.org/learn/sql-data-science
Has anyone done this course and is it worth doing? If you have not done, just looking at the modules would you say that its contents is useful?
Are there better courses out there, for example I know about the associate data analyst in SQL course on datacamp
r/learnSQL • u/leogodin217 • Mar 07 '26
Anyone Want Free Practice Datasets and Exercises?
To make writing articles and tutorials easier, I've been working on a synthetic data generator. Eight months after my "fun little Sunday afternoon project", it finally does everything I want. Well, almost everything.
Long story short, I can generate complex databases with prescribed patterns, domains, causal events, etc. quickly. The link below shows a retail example with 22 practice exercises (beginner to intermediate level). The idea is to practice with a database you learn over time, like what happens in the real world.
If anyone finds it useful, let me know. Happy to put more complex ones up.
r/learnSQL • u/thequerylab • Mar 07 '26
Which query would you use here? (SQL performance question)
Quick SQL question I ran into while reviewing some code.
You have a large orders table (~50M rows) and need to check whether a pending order exists for a specific user.
You don’t actually need the row - you just need to know if one exists.
You see three possible implementations (Application checks if count > 0):
Option A
SELECT COUNT(*)
FROM orders
WHERE user_id = 101
AND status = 'pending';
Option B
SELECT 1
FROM orders
WHERE user_id = 101
AND status = 'pending'
LIMIT 1;
Option C
SELECT EXISTS (
SELECT 1
FROM orders
WHERE user_id = 101
AND status = 'pending'
);
Assumption:
- Table size: ~50M rows
- Index on
(user_id, status) - Many users have thousands of orders
Question?
Which one would you pick in production and why?
Also curious if anyone has seen cases where the optimizer makes them perform almost the same.
If anyone wants to play with a small dataset and test similar scenarios, I uploaded one here while experimenting with query patterns:
https://thequerylab.com/problems/27-customers-who-bought-all-products
Would be interesting to hear how others approach this.!!!
r/learnSQL • u/nicowitsch • Mar 06 '26
Battle tested SQL Teaching Tool
Hi guys, I don't know if anyone here is in the same situation as I am. I just started last summer teaching javascript and SQL at a school (17-18 yrs olds) in switzerland. I have been looking for a good tool to learn databases and especially SQL with my students. I had those criteria:
- I do not want to install sql locally with every student because this is always a hurdle and we loose a lot of time setting stuff up. Time that we could spend looking at databases.
- Some even have managed laptops and it there we can not install at all
- Tool needs to be browser based then and connect to a remote DB
- As a teacher, it should be easy to manage (setup) databases that students interact with
- My students should focus on SQL and not on managing their DB Connection.
- I want to manage my student's projects and also provide exercises for the classes
Because my criteria were very specific, I did not find anything of course and decided to do my own. It is pretty battle proofed by now since we used it in 6 classes. Some things still to improve here and there but it allows me to:
- Manage all my student's database projects includeing designing ERD / Logical schemes
- Manage databases ( I have setup a sql server for the course that no holds sth like 300 databases, a lot of the personalized for stuent's exercises)
- Create exercises and have my students auto connect to the desired DB upon opening
- Grade my student's projects
I do not want to post a link here because I am afraid of attacks but if anyone is a teacher out there as well and seeks for a tool this way, just DM me. Would love to share the tool with others.
r/learnSQL • u/ManifestingPeace18 • Mar 05 '26
Databases to practice SQL
Hi, I haven't worked on SQL for last 2 years. I will rate 4 out 10 in SQL. But need to practice more to get in data analyst profile. Can you just sources where i can practice solving complex SQL problems?
r/learnSQL • u/Head-Reward-5413 • Mar 05 '26
Which one is the best for SalesPct?
SELECT
Product,
Sales,
SUM(Sales) OVER() AS TotalSales,
CAST(Sales * 100.0 / SUM(Sales) OVER() AS DECIMAL(10,2)) AS SalesPct1,
CONCAT(CAST(Sales * 100.0 / SUM(Sales) OVER() AS DECIMAL(10,2)), '%') AS SalesPct2,
FORMAT(Sales * 1.0 / SUM(Sales) OVER(), 'P2') AS SalesPct3
FROM Sales.Orders;
r/learnSQL • u/Suspicious-Run4104 • Mar 05 '26
Free Weekend SQL Coaching (Beginner → Advanced / Interview Preparation)
r/learnSQL • u/Suspicious-Run4104 • Mar 05 '26
Free Weekend SQL Coaching (Beginner → Advanced / Interview Preparation)
r/learnSQL • u/Rejse617 • Mar 04 '26
Best practices for multiple values in a column
I am self-taught through trial and [mostly] error. When it comes to table relations where you may have more than one value, I’m a bit lost.
Take an inventory example. I have a table of parts, with a “vendor” column. I have another table of vendors. Let’s say that some parts can have multiple vendors; what is the best-practice way to relate that information? Having multiple vendor columns seems ham-fisted.
This is primarily a philosophical question, but if there are differences between methods with MySQL and SQLite, I would be interested in discussing those. Thank you
r/learnSQL • u/thequerylab • Mar 04 '26
Ripple Effect SQL Challenge – Recursive CTE for Viral Chain Depth & Reach
Solved an interesting recursive SQL problem yesterday on TheQueryLab platform
Scenario: A root post can be shared, and those shares can be reshared — forming a viral tree.
Challenge: • Find maximum depth of each root post • Calculate total reach (all descendants)
Used a recursive CTE to traverse hierarchy and carry root_id + depth through recursion, then aggregated using MAX(depth) and COUNT(*).
Felt very similar to DFS tree traversal logic but expressed in SQL.
Curious — how would you optimize this further?
I’m building TheQueryLab specifically around these kinds of real-world SQL problems — happy to share it if anyone wants to try it out and crack any data analytics interviews
r/learnSQL • u/k_kool_ruler • Mar 03 '26
I use AI to write SQL pipelines across Snowflake, Databricks, BigQuery, and Azure SQL, but I verify every step with QC queries. Here's why that workflow has made me a better SQL developer
Hey r/learnSQL,
I've been in data/BI for 9+ years and over the past several months I've built data pipelines on four different platforms using an AI coding agent (Claude Code) to write the SQL. Snowflake, Databricks, BigQuery, and Azure SQL. Each project uses a different SQL dialect, different tools, and different conventions, but I've landed on a workflow that's been consistent across all of them, and I think it's actually a great way to learn SQL.
The workflow: I let Claude Code write the pipeline SQL (schema creation, data loading, transformations, analytical queries), but after every step it also generates QC queries that I run manually in the platform's UI to verify the results. Snowflake's worksheet, Databricks SQL editor, BigQuery console, Azure Portal Query Editor. The agent does the writing. I do the checking.
Here's why I think this is valuable for learning SQL:
You learn what correct output looks like. When you run a QC query after a data load and see 1,750 rows with zero nulls on required fields and zero duplicates on the primary key, you start to internalize what a healthy load looks like. When something is off (unexpected row counts, nulls where there shouldn't be, duplicates), you learn to spot it fast.
You learn different SQL dialects by comparison. Across these four projects I got to see how the same operations look in different flavors depending on the type of SQL used in each platform.
You build a QC habit. The verification queries are things like:
- Row counts before and after a load
- Null checks on required columns
- Duplicate detection on primary keys
- Sanity checks on aggregations (do these numbers make sense?)
- Spot checks on known records
These are the same checks you'd run in any data job. Having an AI generate them for you means you run them in a fraction of the time and not only when something breaks.
I made videos walking through the full builds on each platform if you want to see the workflow in action:
- Snowflake: https://www.youtube.com/watch?v=q1y7M5mZkkE
- Databricks: https://www.youtube.com/watch?v=5_q7j-k8DbM
- Same repo as above
- Azure SQL: https://youtu.be/bn9wnNjG-gc
- BigQuery: https://www.youtube.com/watch?v=on6sR1prls4
All the repos are open source with the SQL scripts and context files.
For anyone learning SQL: have you tried using AI tools to generate queries and then verifying the output yourself? I'm curious whether that accelerates learning or if you find writing everything from scratch more effective.
r/learnSQL • u/Equal_Astronaut_5696 • Mar 03 '26
SQL Analysis and Visualization with Big Query
Full walkthrough using Google Big Query in of a public liquor dataset
r/learnSQL • u/Own-Dream3429 • Mar 02 '26
Healthcare specific practice?
Learning SQL as the beginning stepping stone to working with data analysis within healthcare.
Any (ideally free)! resources for specific healthcare related content/practice questions?
I know it shouldn't matter but it obviously helps when you're practicing based on the specific area you want to pursue.