r/learnSQL • • 9h ago

I built a website using SQL – would love to hear your feedback!

3 Upvotes

Hey everyone!

I've been working on a website focused on helping people learn SQL, especially beginners who are just starting their database journey.

The goal is to make learning SQL easier through practical examples and hands-on practice.

I created this project to help people understand SQL concepts, practice queries, and improve their database skills.

I'd love for you to check it out and share your thoughts!

🌐 Website: https://sql-web-xi.vercel.app/

I'd really appreciate your feedback:

  • Is the learning content easy to understand?
  • What topics or features should I add?
  • What would make this website more useful for SQL beginners?

Thanks for checking it out! Any feedback is welcome.


r/learnSQL • • 5h ago

need good sql resources

Thumbnail reddit.com
1 Upvotes

r/learnSQL • • 1d ago

Database design

15 Upvotes

Hey guys.

Gonna be real quick.

I know about databases but I struggle with database design either relational or non relational.

Do you have any resource that I can binge on and like solve this issue once and for all ?

Would appreciate it. Thanks in advance.


r/learnSQL • • 18h ago

A 60-second SQL test with three traps. Most AIs I've graded fall for at least one.

2 Upvotes

I grade AI models on data questions for a living experiment, and the same three mistakes keep showing up. Here's a pocket version: paste it into whatever AI you use and see how it does. The database is SQLite.
sales (sale_id, amount):
1: 412.75 · 2: 268.40 · 3: 529.99 · 4: 145.20 · 5: 876.10 · 6: 233.65
7: 694.30 · 8: 358.55 · 9: 921.00 · 10: 187.45 · 11: 543.80 · 12: 476.25
returns (sale_id, one row per return event, 25 rows):
2, 5, 9, 2, 7, 3, 2, 11, 5, 12, 9, 4, 2, 7, 10, 5, 1, 9, 12, 4, 11, 8, 10, 13, 13
Task: write SQLite SQL returning exactly two columns: returned_sales (how many sales came back) and total_returned_sales (their total value, each sale counted once), and state the two numbers.
Answers, so you can grade it yourself:
Pass: 11 and 5,413.79, exactly two columns, SQL SQLite can run.
Trap 1: a total of 11,860.19 means it joined and summed, so sale 2 was counted 4 times. Counted twice (or four times).
Trap 2: a count of 12 means it counted sale 13, which is in returns but was never sold.
Trap 3: FETCH FIRST, EXTRACT, or more than two columns: wrong database or didn't follow the order.
On the full-size version of this case (500 return rows, 99 sales returned more than once), the counted-twice error invents $31,490.03. I've watched a model miss it twice in graded matches.
Curious what yours answered. Post the number it gave.


r/learnSQL • • 2d ago

Understanding SQL patterns that cover 90% of interview questions

45 Upvotes

Instead of trying to memorize 100 different questions, it helps to learn the underlying patterns. I put together a walkthrough of the 17 patterns I see most often in MySQL interviews, breaking down the logic so you can recognize them instantly.

The core patterns covered:

  • Window Functions: Running totals, LAG for YoY/MoM growth, and 7-day moving averages.
  • CTEs & Recursion: Traversing hierarchies (like employee/manager trees).
  • Gaps & Islands: Finding consecutive login days (a classic tough one).
  • Ranking: Top N per group, 2nd/Nth highest salary.
  • Advanced Joins: Self-joins, monthly cohort retention, and pivot tables using CASE WHEN.

Why this approach helps:
When you see a question like "find the highest sales day," you shouldn't just start typing. You should recognize it as a "Ranking + Filtering" pattern. Once you know the pattern, the query writes itself.

I recorded a step-by-step video solving each of these 17 patterns with the exact queries and explanations of why they work. I also included the dataset/script so you can practice alongside it.

Walk-through:- SQL Interview Questions & Answers MySQL 17 Must Know Patterns

(Note: I'm sharing this because I've seen it help folks in my training sessions—if it helps even one person land a role, I'm happy!)

Question for the community: Which of these patterns trips you up the most in interviews? For me, it was always the "Gaps and Islands" problem.


r/learnSQL • • 1d ago

Websites to practice SQL

4 Upvotes

Any websites to practice excercises of SQL in mobile ??

It should contains all excercise easy to understand and practice

Comfortably in mobile


r/learnSQL • • 1d ago

The one thing that made T-SQL stick for me: check figures on every exercise

4 Upvotes

I've been learning T-SQL on the Chinook sample database in SSMS, and the thing that changed everything was giving every exercise an expected answer to check against — a row count, a total, a specific value. Without it I was just guessing whether my query was right. With it, I know immediately, and the mistake teaches me something. Curious what worked for others here — what made SQL actually click for you?


r/learnSQL • • 1d ago

Free Excel and SQL level tests for beginners: 10 questions each, no sign-up. Tell me where they're too easy or too hard

Thumbnail reddit.com
2 Upvotes

r/learnSQL • • 2d ago

Guidance?

4 Upvotes

Years ago while incarcerated I earned a college cert for Microsoft apps which is now basically outdated. After talking with ChatGPT it recommended learning SQL because I mentioned that I really enjoyed my Access class and after a weird assessment i created noted I have a systems analyst kinda mind. "Investigative".

As a final project for that Access course I had to construct a library database from scratch using queries that could handle isbns, book details, borrower personal info, due dates, late fees (if applicable etc). It was hard but really really cool. Anyway, I went to the w3 site and that seems cool but I feel like I need a book, and to take notes and work on stuff on my computer. But I have no real idea how to begin or why id even do this esp vs Access refreshing???

Im a truck driver and would love to get out of it but im also a 8x felon. So...i dont wanna waste my time. Is SQL worth learning to move up or pivot? I see it occasionally in job searches. And how would you approach learning it if so? Lastly am I doing all of this to go like test somewhere and get a certification? Or is it a show me what you can do kinda thing?

- notable fact: I tried doing a boot camp for CSS a few years ago and got through the first level. At the second I kinda fell out of it due to lack of motivation even after taking a FrontPage class (in that program) but mostly due to talking myself out of it knowing my background. Plus I just wasnt really in love with CSS 🤷🏾‍♂️

Sorry this is so long but I figured some context may help.


r/learnSQL • • 2d ago

I built ForgeSQL, a hands-on learning platform for SQL and data engineering

4 Upvotes

Sharing something I built: ForgeSQL, a browser-based learning platform for SQL and data engineering.

For SQL practice, there are guided exercises with sample tables, a query editor, results, and solutions you can compare with your own approach. You can start with joins and move on to window functions, then explore Python, file ingestion, pipelines, APIs and Kafka in the same workspace.

The idea is to try a query, inspect what happened, and change it until you understand why it works. It runs on DuckDB, so SQL dialect differences still apply.

It’s an early public beta. If you’re learning SQL, I’d appreciate hearing which exercises are helpful and where the instructions need work.

https://forgesql.clawiz.com/

Screenshot: https://forgesql.clawiz.com/assets/hotlink-ok/forgesql-workspace.png


r/learnSQL • • 2d ago

Day 78 — Hospital Management System: connecting the classes

3 Upvotes

Today I added BillingService, AppointmentService, and Schedulable to my Hospital Management System.

Writing each class was not the hard part. Connecting them so they work together was much harder, and it is the part no tutorial prepared me for. I used GPT as a mentor to understand the connections, not to write the code for me.

Tomorrow I will write the Main class to bring everything together.


r/learnSQL • • 2d ago

hi guys so i am a frontend dev and now i wanna expand into fullstack and for that i need to learn postgresql and about ORMs so what should materials should i check out which would help me to bridge to sql from only frontend?

3 Upvotes

r/learnSQL • • 2d ago

Text column is storing accented text weirdly

Thumbnail reddit.com
1 Upvotes

r/learnSQL • • 2d ago

Confusion about joining tables.

9 Upvotes

can anyone help me to understand how one to many relation tables work .how to avoid duplicates when joining.i am struggling to understand how it works


r/learnSQL • • 2d ago

Is there any point proofreading SQL an agent wrote?

2 Upvotes

My manager has started pasting Claude-written SQL into Slack with "can you check this is right?". They always look fine on the page. Last week's joined to dim_customer_v2, which still exists but stopped updating in March. The one before used a revenue column that includes tax because it's the one with the obvious name. Both read perfectly well, both answers were wrong, and I only caught them because I happen to know the history of those tables. I mean, our BI tool's chat shows the SQL behind every chart now too, and I don't see how reading it would have caught either of those. Right now the only real check is whoever happens to remember the history of the tables.


r/learnSQL • • 2d ago

Sql skill level

Thumbnail reddit.com
1 Upvotes

Sql skill level

What level of expertise should I have in Sql, to carry out sql tasks in data annotation jobs ?

How about python ?

Does these two skills widen my task availability? What platforms can I target for ?

Kindly guide me !


r/learnSQL • • 3d ago

Day 77 — Hospital Management System: added Appointment and RoomService

2 Upvotes

Two more classes today:

  • Appointment, which links a patient with a doctor
  • RoomService, which manages the hospital rooms

The project now has doctors, patients, billing, appointments, and rooms. Following the advice from earlier comments here, I kept each part in its own class and the logic in service classes.

For people who have built an appointment system: what edge cases should I plan for first (double booking, an unavailable doctor, cancelling an appointment)? I want to handle them with custom exceptions from the start.


r/learnSQL • • 3d ago

Free Excel and SQL level tests for beginners: 10 questions each, no sign-up. Tell me where they're too easy or too hard

9 Upvotes

I see a lot of "am I ready to apply?" posts here, so I built two short tests to answer that with something other than a certificate.

\- Excel: 10 questions in a real spreadsheet, from SUM and IF up to VLOOKUP and INDEX/MATCH. [https://getsheetdrill.com/test

\- SQL: 10 questions on a real database, from SELECT up to JOINs and subqueries. [https://getsheetdrill.com/sql/test

You type the formula or the query, it runs in your browser and gets checked right away. Typing the result by hand doesn't pass. At the end you get your level and which topic to study next.

Both are free and need no account. The site has paid lessons further on, but the tests and the first lessons are free.

I made it, so I'm biased. What I'd like to know: which question felt unfair, and what topic is missing for an entry-level analyst role?


r/learnSQL • • 4d ago

Title: Day 75-76 — Combined update: Hospital Management System, adding Billable, Inpatient/Outpatient, and service classes

2 Upvotes

Progress on my Hospital Management System over the last two days. I added:

  • Billable
  • Inpatient and Outpatient classes
  • PatientService and DoctorService

In DoctorService I wrote methods to search doctors by specialization (case-insensitive), update a doctor's availability (throwing a custom DoctorNotFoundException if the ID doesn't exist), list the departments, and view all doctors.

I followed the advice from earlier comments here: keep the model classes simple, put the logic in separate service classes, and use custom exceptions for errors.

For people who've structured something similar: do you keep the doctor collection inside the service class, or in a separate repository class? I'm not sure whether the service is taking on too much.


r/learnSQL • • 4d ago

Is SQL certificate for free worth it ?

6 Upvotes

Hello, I want to learn SQL in hopes to become a data analyst. We don’t have SQL course in our university so I stumbled upon a website that teaches you SQL and you get a certificate after. However the certificate is for free so it’s not taken seriously. I am just wondering if it’s worth even completing or should I pay for one ? I am wondering what would look good on my CV


r/learnSQL • • 4d ago

Does SQL pair well with a marketing degree?

4 Upvotes

I actually graduated 4 years ago and eventually got a marketing job this year, but it’s boring, I work in SEO and there’s nothing fulfilling about it, also the pay is terrible.

I was looking into skills that could make me more valuable o to go alongside my marketing experience and SQL came up, is it worth it?


r/learnSQL • • 4d ago

MySQL Query Optimization in 2026?

11 Upvotes

How to actually learn because I think they are very important for a SQL engineer in 2026...More so than ever.

I want to learn the details of cost-based and heuristic-based query optimization. The problem is I am from Nepal and we do not have libraries or digital courses service from libraries.

To the USA people: Please consider tell government to help us read and learn in a mass way.

I would really appreciate if you guys could help me out.

I found lots of free resources in google pdfs, but they are lecture slides meant to be accompanied with the lecture. But the problem is that lecture video is not freely accessible.

I am willing to pay huge money to learn this thing.


r/learnSQL • • 4d ago

FREE Ebook - Your First 30 Days as a DBA

16 Upvotes

(Portuguese, English, and Spanish versions)

Most of us didn't plan to become DBAs. One day the databases were ours, and we learned the rest in production.

Get the free ebook: https://www.dbatopro.com/products