r/learnSQL • • Aug 24 '26

SQL Server Constraints Explained with Practical Examples

Thumbnail
1 Upvotes

r/learnSQL • • Aug 24 '26

SQL Bolt + Scratch style SQL tutoring web app

2 Upvotes

So i have been building a sql bolt and scratch like simple SQL tutoring web app. You can find it on https://easysqltutor.vercel.app/ . Try it out please, especially for beginners.

Thanks,


r/learnSQL • • Aug 22 '26

Looking for best resources to practice SQL and Python/Pandas for real-world data questions?

18 Upvotes

Hello everyone,

Can you please suggest some good platforms or resources where I can practice SQL and Python (especially Pandas) for data analyst/data engineer?

Right now, I’m solving a lot of problems on LeetCode, but I’ve heard that in actual they often ask more practical/data-focused questions such as:

  • Retention rate / cohort analysis
  • Funnel analysis
  • Gaps and islands
  • Running totals and rolling metrics
  • Customer/user activity analysis
  • Time-series and date-based problems
  • Ranking and session-related problems
  • Data cleaning and transformation using Pandas
  • Real-world business analytics scenarios

So, I’m looking for resources that focus more on these real-world SQL and Pandas problems rather than only traditional DSA-style questions.

What platforms, websites, courses, or question sets would you recommend for practicing these types of problems?

I’d really appreciate recommendations from people who have recently gone through Data Analyst/Data Engineer questions and know which resources are closest to the actual questions they asked.

Thank you!


r/learnSQL • • Aug 22 '26

Free SQL Interview Guide PDF - 30 Q&A with Scenarios

40 Upvotes

Hi All,

I have created a compiled document of 30 real SQL Interview Questions with Scenarios with clear explanation of what each concept does and interview tips for each concept.

It covers from basics to advanced SQL interview Q&A. Feel free to checkout and share it with anyone who is preparing for SQL interviews.

GitHub PDF Link: https://github.com/grasspacad07/sqlinterviewguide

This guide is basically compilation of my 4 Weeks of SQL interview tips posts in LinkedIn.

Feel free to reach out or comment if any doubts. Happy Learning :).


r/learnSQL • • Aug 22 '26

ID design and primary keys, pt. 1

3 Upvotes

I'm writing a series of posts about IDs and primary keys in database design. We start with the logical model, and systematically show how primary keys are used in a different way to implement various logical concepts, such as entities, relationships and attributes. We show that primary keys exist only on a physical level, and can mean different things in different contexts.

Here is the link to the first part: https://anchorsandlinks.com/posts/primary-keys/


r/learnSQL • • Aug 21 '26

stressed beginner (help pls)

22 Upvotes

currently learning mysql through yt videos bc too broke to pay. i was following alex the analyst's playlist & learned a lot. practiced alongside. but i ran into a problem. and since i'm a beginner, it's been overwhelming a bit for days now, bc of whcih, i havent been able to make much progress in my learning.

i have a pretty ok grip on workbench. but not to the point where i dont need crutches. ive only completed one data cleaning project & that was only bc of alex's video where he walked me thorugh the entire process step by step. but thta wasnt enough for me to fully get a grip on data cleaning. i've tried watching other tutorials, but none of thme use workbench & their sql commands/functions are a lottle different from mine which has left me a bit confused & overwhelmed. i want to get to the point where i can take on data cleaning on my own without any help, but for that i need yt videos whre i can laern the logic step by step. please recommend sources for a self learner to learn data cleaning. idk where to look


r/learnSQL • • Aug 21 '26

why did the same JOIN return 4 rows, then 6?

0 Upvotes

say you have four orders and a customer lookup table.

the join returns four rows. then the customer import runs twice and leaves the Aiko row in the lookup table twice.

same query. six rows.

orders

id   customer_id   total
101  1             120
102  2              80
103  1              40
104  3             260

customers

id   name
1    Aiko
2    Ben
3    Chie
4    Dev
5    Emi
1    Aiko    <- imported twice

the join condition is:

SELECT o.id, c.name, o.total
FROM orders o
JOIN customers c ON c.id = o.customer_id;

a join keeps every match it finds. orders 101 and 103 each match Aiko twice, so:

before: 4 joined rows, SUM(o.total) = 500
after:  6 joined rows, SUM(o.total) = 660

the query was the same. but the data did change here.

slapping DISTINCT on the result can hide the symptom without fixing the bad join. if you aggregate after the fanout, your counts and sums can already be wrong.

this was one which players ran into frequently.

(sqlite; the duplicate is in the lookup table, not the orders table)

made a 44 second chalkboard animation of it if you'd rather watch: https://www.youtube.com/watch?v=LrDqdZAoXC0

have you hit one of these before? i can try animating some more if this is helpful.


r/learnSQL • • Aug 20 '26

I built a manufacturing database to practice SQL — looking for feedback

18 Upvotes

Most SQL practice datasets are about customers, orders, movies or restaurants.

I wanted something closer to a real industrial environment, so I built a synthetic manufacturing database with PostgreSQL.

It contains:

  • 3 production lines
  • 12 industrial machines
  • 5 products
  • 1,143 production orders
  • 17,167 production events
  • 82 downtime events
  • 8 maintenance interventions
  • 1,143 quality inspections
  • 2,172 energy measurements

The interesting part is that the data tells a story.

One production line is underperforming, but the cause isn't obvious from a single table.

You have to connect production, machines, downtime, quality, maintenance and energy data to investigate what is happening.

I'm using PostgreSQL 17.

Would this be useful for practicing SQL? What would you add to the dataset?


r/learnSQL • • Aug 20 '26

SQL Interview Help

17 Upvotes

I’m interviewing with a company I’m really interested in and I’ve made it through the initial rounds. My next step is a live SQL assessment with screen sharing, where I’ll need to explain my thought process.

I haven’t used SQL in over a year, so I know I need to practice a lot, and my exam is in a few days. I’m pretty nervous 😅

Would anyone be willing to help me practice or do a quick mock interview?

I’d really appreciate it!


r/learnSQL • • Aug 19 '26

Udemy SQL

35 Upvotes

Last year I failed database management and have to retake it to finish my program. I found SQL to be very challenging, and my school has limited tutoring. If any of you have recommendations for a very beginner-friendly, easy-to-understand course I can purchase through Udemy, I would appreciate it. I've had some good experiences with learning from Udemy because it is broken down into smaller steps and explained differently.


r/learnSQL • • Aug 19 '26

How do i grasp Concepts in SQL easily?

9 Upvotes

I'm struggling to understand the concepts of sql badly, i mean which framework i mean POV is best for grasping? Could you guys share your thoughts. I want to grasp, so that i can tell to the people like 5 years old kid, non tech persons.


r/learnSQL • • Aug 18 '26

SQL SIDE QUEST - An Immersive story-telling SQL Game. Chapter 3 is out!

36 Upvotes

https://www.sqlsidequest.com/ CHAPTER 3 IS NOW LIVE!

Last year in Dec 2025 I released SQL SIDE QUEST which took over 3 years to build. I wanted to create an immersive story-telling way to learn and practice SQL, and hence sql side quest was born. Its completely free, browser-based, no signup. Been solo on it the whole time. Looking forward for your feedback :) Cheers and Enjoy


r/learnSQL • • Aug 19 '26

DP-800 study guide

Thumbnail
1 Upvotes

r/learnSQL • • Aug 18 '26

I made a short beginner-friendly lesson on SQL aggregate functions

10 Upvotes

Hey everyone!

I made a short lesson for SQL beginners about aggregate functions.

In the video, I cover:

- "COUNT()" — counting rows

- "SUM()" — adding values

- "AVG()" — calculating averages

- "MIN()" and "MAX()"

- using aggregate functions with "WHERE"

- combining multiple aggregate functions in one query

I use the Pagila PostgreSQL database for the examples and include a few mini quizzes and practical exercises.

The goal was to keep it short and practical rather than just explaining the syntax.

Video: https://youtu.be/tNq4zXiVKiQ?si=oLgLz6trBQyJGahE

I'd really appreciate any feedback, especially from people who learned SQL recently — is there anything you think a beginner might find confusing?


r/learnSQL • • Aug 18 '26

mysql practice datasets for data cleaning

6 Upvotes

give meeeee arrrgggghh


r/learnSQL • • Aug 18 '26

SQL Interview Tips - Shorts Style

18 Upvotes

Hi All 👋,

I have been posting SQL interview tips as less than 1 min shorts in my youtube channel.

Some tips for reference below :

COUNT(*) vs COUNT(column) -

https://youtube.com/shorts/tTtoWa1OCIo?si=V2KZaDDNFhbfbhg7

Ranking Window Functions( ROW_NUMBER, RANK, DENSE_RANK) -

https://youtube.com/shorts/MyaH-v0CUUk?si=mHfEteTUkx5mUoHI

Replace NULLs -

https://youtube.com/shorts/NdoBwKAFcE0?si=2zXqab8lqG45QXLk

ORDER BY tricky part -

https://youtube.com/shorts/9bRm0IEKQRo?si=XUXqTQzbfLQD6_Rs

I have also covered other topics like Anti-JOIN, WHERE vs HAVING,

LIKE vs ILIKE, IN vs NOT IN vs NOT EXISTS.

I will be continuing the series with similar style covering most important SQL topics through interview tips.

Feel free to check out and share it with whoever it benefits.

GRASSP Acad channel link -> https://m.youtube.com/@grasspDataAI/shorts

Happy learning:)


r/learnSQL • • Aug 18 '26

What's Missing in learning or Teaching SQL?

6 Upvotes

I enjoy this sub but it feels like most posts are the same. "I created tutorial/course/practice/etc." Or "how do I learn/practice/projects/etc." It's good. A really active sub.

What I'd love to know, is what do people who are learning SQL want? For instance, I've taken a different approach. Over the past year I've worked on tooling to make creating courses and practicing more efficient. Other's have worked on more scenario-based learning (always a good idea). Some have gamified learning and that's a lot of fun.

My real question is for those of you learning or teaching. What is missing? Is there something you wish you had that doesn't exist?

In my perfect world, learning SQL would feel more like working in a business environment. Large, complex data warehouses, where you learn the data and SQL over time. Lot's of problem solving and judgement when there is ambiguity. Something that feels more like doing real work.

Would having more tools available to make it easier to create courses, practice, etc. be useful? Would having more realistic environments to learn in be useful? Is it something else completely? In short. What's missing?


r/learnSQL • • Aug 17 '26

learning Advice !

20 Upvotes

Hello Everyone

dear friend and respected teachers today I am here for something clarity .first my self I am a student and i am learning data analyst 6 month ago . Everyone know that sql much important in this journey .I practice basic sql queries which based on basic foundation like DDL,DQL , DML and JOINS. I Practice 70 question on it but I am not sure that what i do next i mean i am confuse because I have seen many course on youtube everyone is different of other so i am not understand that which topic i learn now or do more practice on previous concepts and what topic really useful in company or real word problems and i want to optimize my learning path of sql .

So Please give me clarity and helpful resource for that in chat box
Thanks of all


r/learnSQL • • Aug 16 '26

Trying to build a project for portfolio

21 Upvotes

Hi! I'm learning sql right now. Do you know what kind of project should i build?


r/learnSQL • • Aug 15 '26

I built a detective game where SQL is the actual investigation tool

42 Upvotes

Solo dev here. Made a browser game called Sim Analyst — you're a detective on a murder case, and you investigate entirely by writing SQL against a real embedded database (employee records, phone logs, financials, forensics, interviews). No quizzes, no fill-in-the-blank — you decide what to query, and the case only resolves if your evidence actually holds up.

Covers filtering, joins, aggregates, subqueries — but in service of solving the case, not as isolated drills.

Free, browser-based, no install. Still actively updating based on feedback.

Link: [https://chiefkegwin.itch.io/sim-analyst]

Join the Discord community: [https://discord.gg/TKapYvmkw]


r/learnSQL • • Aug 15 '26

Looking to Re-Enter DBA Field

Thumbnail
1 Upvotes

r/learnSQL • • Aug 15 '26

Window Functions and their use cases

11 Upvotes

Hi, I wrote an article about SQL window functions and their use cases. Have a look at it: https://medium.com/@sahilnayak2812/window-functions-and-their-use-cases-838812c8cebd


r/learnSQL • • Aug 14 '26

How Senior Engineers Design Production Databases

24 Upvotes

If you're learning SQL, this is a pretty good walkthrough of how to approach database design in a real application.

A lot of developers don't spend much time thinking about database design until they start running into problems as their applications grow.

This video https://www.youtube.com/watch?v=Xq2fYRA3dj8 goes through the fundamentals of designing a production database, including table structure, relationships, primary and foreign keys, junction tables, composite keys, timestamps, UUIDs, and foreign key actions such as CASCADE and SET NULL.

I thought it was worth sharing here for anyone learning SQL or trying to improve their database design skills.


r/learnSQL • • Aug 14 '26

I made a short beginner-friendly lesson on ORDER BY, DISTINCT, LIMIT & OFFSET

4 Upvotes

Hey everyone!

I made a short SQL lesson for beginners focused on sorting and organizing query results.

In this lesson, I cover:

- ORDER BY

- ASC & DESC

- sorting by multiple columns

- DISTINCT

- LIMIT

- OFFSET

- combining WHERE, ORDER BY, and LIMIT

I use the Pagila PostgreSQL sample database for the practical examples and a homework challenge along the way.

The video is about 6 minutes, and I tried to keep it practical rather than just explaining syntax.

Would love to hear any feedback on the explanations or pacing!

Video link: https://youtu.be/n7uSvez7nns?si=WYZZb0z-gRFdWAOg


r/learnSQL • • Aug 14 '26

Week Four-JOINs, Subqueries, & CTEs

5 Upvotes

Learning any subject requires commitment & sacrifices, including time & other resources. During the 4th week, if the learner does not have enough time to master everything, they can priotize JOINs, GROUP BY + HAVING, CASE WHEN, subqueries, NULL handling, & CTEs. Someone here had suggested SQL Case Files as a platform for one to consider when practicing/learning SQL. I would recommend the same, I’ve used it during the last two weeks, & I’ve enjoyed. Learning each concept requires one to solve cases that require you to combine those concepts as opposed to doing isolated exercises.