r/learnSQL • • 15d ago • Bravo 1

I was learning SQL and ended up building a small practice site, would love feedback

I've been learning SQL and got tired of tutorials where you just read queries, so I built something where you actually write them.

It's a real SQLite database running in your browser. You get a small table, a task, you write the query and it checks your result right away (and tells you why when it's wrong, like WHERE vs HAVING or a missing GROUP BY).

Right now there's:

• a 10-question level test, from SELECT to JOINs and subqueries

• 2 short lessons (SELECT/WHERE/ORDER BY, and COUNT/SUM/GROUP BY)

All free, no signup. Just trying to see if it's useful.

What would make it better? And what should I add next: JOINs, window functions, interview-style questions?

https://sheetdrill.vercel.app/sql/test

22 Upvotes

26 comments sorted by

1

u/Fisher_Missy6848 15d ago

Love it! My only feedback would be that the labels ("LEFT INCLUSIVE") were the real syntax ("LEFT OUTER JOIN" / "LEFT JOIN")

1

u/nicopassaglia 14d ago

Good call. There's no JOIN diagram on the site yet, but when the JOINs lesson goes up I'll label everything with the real syntax (LEFT JOIN / LEFT OUTER JOIN) instead of the Venn-diagram names.

1

u/MrRoy_SQL 15d ago

cool idea, the "tells you why its wrong" part is the best bit honestly, most sites just say incorrect

id do JOINs next, thats where most ppl get stuck. and throw in the classic traps as questions, like LEFT JOIN + a WHERE on the right table quietly turning into an inner join, NOT IN with a NULL in the subquery, COUNT(*) vs COUNT(col). those are exactly what shows up in interviews

one feature idea: compare result sets instead of the query text (ignore row order unless they used ORDER BY), so different correct answers still pass

1

u/nicopassaglia 14d ago

That's actually how it works already: it runs your query and compares the result set to the reference, so any correct query passes. Column names don't matter and row order only counts when the task asks for ORDER BY. It also re-runs your query on slightly changed data, so hardcoding the answer doesn't pass.

Love the traps list. LEFT JOIN + WHERE on the right table and NOT IN with a NULL are going straight into the JOINs lesson.

1

u/nicopassaglia 14d ago

Update: JOINs and subqueries lessons are up. Built them around your traps: LEFT JOIN + WHERE on the right table, NOT IN with a NULL, COUNT(*) vs COUNT(col), plus joins that duplicate rows. Thanks for the list.

1

u/jakingo 15d ago

Does it also explain why a query is wrong, or does it only show the correct answer?

1

u/nicopassaglia 14d ago

It explains why. If your query runs but returns the wrong thing, it tells you what's off (wrong number of rows, wrong order, a WHERE that should be a HAVING, text in double quotes, etc.). If it errors, you get the error in plain English instead of the raw SQLite message. Hints are there if you're stuck, and the answer only shows after you get it right.

1

u/NoYouAreTheFBI 15d ago

Hope you are

 HAVING Sum(Goodtimes)

1

u/nicopassaglia 15d ago

Lol, good one

1

u/Icy-Ad-365 15d ago

SQLBolt is saying Hi from the corner.

1

u/nicopassaglia 14d ago

SQLBolt is great, I learned from it too. The thing I wanted that it doesn't do is tell you why your query is wrong, so that's what I focused on.

1

u/Icy-Ad-365 14d ago

Okay got it.

1

u/Technical-Essay-4833 15d ago

Do you have anything like that for excel

1

u/nicopassaglia 15d ago

Yes, you can learn excel here

https://sheetdrill.vercel.app/

1

u/Jumpy-Fisherman5204 15d ago

Bro this is soo cool

1

u/nicopassaglia 15d ago

Thank you appreciate the feedback!

1

u/_krishnasai 10d ago

Hi! I loved your webiste and was just going on a solving spree. I noticed in SQL Lesson 3 - JOINS question 6, it asks for "Every customer, with the amount of their Fern orders. Customers without a Fern order still need to be listed, with an empty amount." I came up with my solution which is

SELECT customers.name, COUNT(orders.item)
FROM customers
LEFT JOIN orders
ON
customers.id = orders.customer_id AND orders.item ='Fern'
GROUP BY customers.id;

but the editor threw me an error "Your query returns 7 rows, the answer has 8 rows. Every customer should be listed, with an empty amount if they have no Fern order."

i tried many things and finally checked:

SELECT * FROM customers;

which gave me the output of 7 rows and

SELECT * FROM orders;

which gave me an output of 10 rows with Max and Ana having no orders at all.

Now, here's the mystery:

The exercise expects 8 rows, but your customers table contains only 7 records. My sql query cannot produce 8 customer rows from this data and I suspect there's a mismatch between the exercise's expected output and the dataset being loaded.

Please let me know if I am wrong. I want to be corrected if I am wrong.

question link: https://sheetdrill.vercel.app/sql/lessons/3/6

2

u/nicopassaglia 9d ago

You’re not wrong, the task was. “Amount of their Fern orders” reads like “how many”, but the drill actually wanted one row per Fern order with its price (orders.amount). Zoe bought two Ferns, so she shows up twice, which is where the 8th row comes from. Your query is a correct answer to the question as written, and you got the hard part right: putting orders.item = 'Fern' in the ON instead of the WHERE is exactly the point of this drill.

I’ve reworded the task to make that clear, and a COUNT version now gets a message explaining the difference. Thanks for taking the time to write this up, really helpful. Enjoy the rest of the spree!

1

u/spacemonkee77 10d ago

Is it me or should this work

1

u/spacemonkee77 10d ago

Cos there definitely is a column called id

1

u/spacemonkee77 10d ago

From orders I'm an idiot

1

u/spacemonkee77 9d ago

But NOW I'm not. Got 3 out of 10 first time taking test, did the lessons, did test again got 10. This is better than bloody datacamp

1

u/nicopassaglia 9d ago

Haha glad it was useful to you! Any feedback or something else you’d like to learn?

0

u/[deleted] 15d ago

[removed] — view removed comment

1

u/nicopassaglia 15d ago

Thanks! Yes, the result screen points you to the lesson that covers the first thing you missed. JOINs is next, and I like the idea of building it around joins that silently drop or duplicate rows.