r/SQL • • 15d ago

Discussion I built a free SQL practice site where an AI writes queries with subtle bugs and you have to find them

Hello. I'm the maker, so take this as a self-promo post, and tell me if it doesn't fit here.

Most SQL practice I found is "write a query from scratch". On the job, a lot of the work is reading someone else's query and noticing it's wrong. Now that "someone" is often an AI. So I built Practisheet: SQL and Excel exercises on one fictional company's data (orders, customers, products, shipments, refunds, targets), where about 1 in 4 exercises gives you a query an AI assistant wrote that looks fine but isn't. A few examples:

  • a LEFT JOIN whose WHERE clause quietly turns it into an inner join
  • a share-of-total with the wrong denominator
  • a RANK with no tie-break, so the "top 3" has 4 rows
  • a revenue total that includes refunded orders

It runs in your browser (DuckDB), checks your result set, and when you're wrong it tells you what's off about your attempt without showing the answer.

There are 101 SQL exercises in 14 sections: basics, NULLs, CASE and conditional totals, joins, anti and self joins, set operations, dates, strings, CTEs, window functions, LAG/LEAD and moving averages, and analysis patterns like cohorts and actual vs target. The first 4 are free with no sign-up.

Link in the first comment (or here if links are fine): https://practisheet.com/practice

I'd really like feedback on two things: are the "fix the AI" exercises realistic, and is the difficulty curve right? If something is wrong or annoying, tell me and I'll fix it.

0 Upvotes

6 comments sorted by

1

u/usernamexxl 15d ago

Lo intentaré probar pero mi nivel de inglés será un pequeño inconveniente. Traducción al español seria un 10. Aún así gracias por la iniciativa

2

u/Spiritual_Potential4 14d ago

¡Ya está! Puedes practicar en español aquí: practisheet.com/es/practice

Los ejercicios de Excel y SQL, las misiones y las pruebas están traducidos. Los nombres de tablas y columnas de los datos siguen en inglés (como pasa en la mayoría de empresas), pero todas las explicaciones están en español. Si ves algo mal traducido, dímelo y lo corrijo 🙏

1

u/usernamexxl 14d ago

Gracias, en cuanto tenga tiempo lo probaré. Agradezco tu ayuda.

1

u/Spiritual_Potential4 14d ago

¡Gracias por tu interés! Mañana estará disponible en español. 😊

1

u/ontirius 14d ago

the realism is the part that matters. the one that bites most at work isnt in your list though: joining a one-to-many table and then summing a value from the parent, so the total comes out inflated and nothing looks broken.

same family as your wrong denominator one i guess. cant judge the curve without trying it, but window functions are where people usually stall.

1

u/Spiritual_Potential4 14d ago

good call, and yeah it's the same family. it's actually in there, just didn't make my list: one of the audits has the AI join the monthly targets to the sales rows and then sum the target, so every region "beats" its target several times over and the query runs without a single error. you have to notice the numbers are too good and fix it (aggregate before the join). there's another one where a join makes the product catalog look way bigger than it is.

window functions come later in the sql track (running totals, rank within a group, best month per region). agree that's where people stall, so if you do try it i'd really like to hear where it gets hard