TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Are there any websites for SQL puzzle games?

157 pointsby novoreorxabout 1 year ago
As a Python programmer, I often use Django or SQLAlchemy ORM and as a consequence, my proficiency in raw SQL remains at a basic level. However, I am keen on improving my raw SQL skills, given it&#x27;s sometimes superior to ORM, and because I find SQL and relational algebra surprisingly fun to think about.<p>Does anyone know of websites that provide SQL puzzle games that allow users to solve problems by writing SQL and validating them? I believe this would be an engaging way to enhance my SQL skills. Your suggestions are appreciated!

23 comments

jiehongabout 1 year ago
Maybe less fun than others, but actually not so bad: leetcode [0]<p>Otherwise, in the same vein as the SQL murder mystery, you can try the Hanukkah of Data [1].<p>[0]: <a href="https:&#x2F;&#x2F;leetcode.com&#x2F;problem-list&#x2F;leetcode-curated-sql-70&#x2F;" rel="nofollow">https:&#x2F;&#x2F;leetcode.com&#x2F;problem-list&#x2F;leetcode-curated-sql-70&#x2F;</a><p>[1]: <a href="https:&#x2F;&#x2F;hanukkah.bluebird.sh" rel="nofollow">https:&#x2F;&#x2F;hanukkah.bluebird.sh</a>
评论 #39555175 未加载
评论 #39556008 未加载
shouldnt_beabout 1 year ago
I often use <a href="https:&#x2F;&#x2F;pgexercises.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pgexercises.com&#x2F;</a> to refresh my knowledge
NortySpockabout 1 year ago
Others have given you excellent suggestions; I will simply offer an addition -- a side quest, if you will:<p>Remember that the local single-user databases SQLite and DuckDB exist, and that you can use them to wrangle data without even having to set up a separate server. You just create a database file on your machine and go from there.
评论 #39570780 未加载
评论 #39571209 未加载
aronoabout 1 year ago
I’ve had fun going through SQL Murder Mystery (<a href="https:&#x2F;&#x2F;mystery.knightlab.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mystery.knightlab.com&#x2F;</a>)<p>I even use it for hiring exercises.
评论 #39570086 未加载
newprintabout 1 year ago
www.sql-ex.ru + the book on that site are by far the best SQL exercises I have seen. PS. I know you asking about just RAW SQL, but I highly suggest you get into understanding how particular DBMS works in depth, what plans it builds, what concurrency mechanisms it uses. Writing raw SQL will get you only so far, making those queries actually production ready is completely different ballgame and for that, you don&#x27;t need to be super proficient in SQL.
评论 #39569273 未加载
Leftiumabout 1 year ago
SQL Police Department – Learn SQL while solving crimes:<p>- <a href="https:&#x2F;&#x2F;hw.leftium.com&#x2F;#&#x2F;item&#x2F;23066776" rel="nofollow">https:&#x2F;&#x2F;hw.leftium.com&#x2F;#&#x2F;item&#x2F;23066776</a><p>Lost at SQL: The SQL learning game:<p>- <a href="https:&#x2F;&#x2F;hw.leftium.com&#x2F;#&#x2F;item&#x2F;35665142" rel="nofollow">https:&#x2F;&#x2F;hw.leftium.com&#x2F;#&#x2F;item&#x2F;35665142</a><p>There are even more games in the comments.
leifhkaabout 1 year ago
Not quite puzzles, but since someone else mentioned Schemaverse, I have made a similar but Elite inspired SQL-game called Datastar [1]. It features a simulated economy with traders and miners, and the goal is to make as much money as possible. Everything is done via SQL (or other PostgreSQL features), and the player need to make and manage a database of information about the planets and their economies.<p>I teach uni. couses on databases and made the game for my student to give them a more self-driven way to learn SQL.<p>[1] <a href="https:&#x2F;&#x2F;gitlab.com&#x2F;leifhka&#x2F;datastar" rel="nofollow">https:&#x2F;&#x2F;gitlab.com&#x2F;leifhka&#x2F;datastar</a>
评论 #39572912 未加载
liamNabout 1 year ago
Maybe this is more begginner than youre looking for, but I saw this one (&quot;Lost at SQL&quot;) here on HN last year. <a href="https:&#x2F;&#x2F;lost-at-sql.therobinlord.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lost-at-sql.therobinlord.com&#x2F;</a>
geshanabout 1 year ago
Not a game but a great way to learn SQL is <a href="https:&#x2F;&#x2F;sqlbolt.com" rel="nofollow">https:&#x2F;&#x2F;sqlbolt.com</a>
评论 #39568956 未加载
speedgooseabout 1 year ago
A few of them exist. I played a bit on the SQL section of HackerRank in the past: <a href="https:&#x2F;&#x2F;www.hackerrank.com&#x2F;domains&#x2F;sql" rel="nofollow">https:&#x2F;&#x2F;www.hackerrank.com&#x2F;domains&#x2F;sql</a>
评论 #39549918 未加载
gabrielsrokaabout 1 year ago
Might be somewhat helpful <a href="https:&#x2F;&#x2F;www.khanacademy.org&#x2F;computing&#x2F;computer-programming&#x2F;sql" rel="nofollow">https:&#x2F;&#x2F;www.khanacademy.org&#x2F;computing&#x2F;computer-programming&#x2F;s...</a>
evilottoabout 1 year ago
There used to be a multiplayer space game called Schemaverse that was played by writing sql, but it seems to have gone away.<p><a href="https:&#x2F;&#x2F;schemaverse.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;schemaverse.com&#x2F;</a>
评论 #39568198 未加载
BazookaMusicabout 1 year ago
<a href="https:&#x2F;&#x2F;detective.kusto.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;detective.kusto.io&#x2F;</a><p>It&#x27;s not SQL directly (it&#x27;s the Kusto query language) which is more geared towards reading data and analytics.<p>I&#x27;m suggesting it however because the queries in it are also basically relational algebra (aka much of the knowledge is transferable to SQL - minus some special features like anomaly analysis), they give decently sized datasets with billions of rows and the challenges themselves were fun.
PascLeRascabout 1 year ago
Select Star SQL is pretty interesting, but short - <a href="https:&#x2F;&#x2F;selectstarsql.com&#x2F;beazley.html" rel="nofollow">https:&#x2F;&#x2F;selectstarsql.com&#x2F;beazley.html</a>
roland35about 1 year ago
This SQL murder mystery is fun and helpful! <a href="https:&#x2F;&#x2F;mystery.knightlab.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mystery.knightlab.com&#x2F;</a>
uncharted9about 1 year ago
Thanks everyone who have commented all these sites. I wanted to brush up SQL for interviews and these will help a lot.
laowantongabout 1 year ago
At beginner level, there is SQL Island <a href="https:&#x2F;&#x2F;sql-island.informatik.uni-kl.de" rel="nofollow">https:&#x2F;&#x2F;sql-island.informatik.uni-kl.de</a>, with versions in German, English and French.
评论 #39570744 未加载
horsellamaabout 1 year ago
<a href="https:&#x2F;&#x2F;code.golf&#x2F;rankings&#x2F;holes&#x2F;all&#x2F;sql&#x2F;bytes" rel="nofollow">https:&#x2F;&#x2F;code.golf&#x2F;rankings&#x2F;holes&#x2F;all&#x2F;sql&#x2F;bytes</a>
yurpree43about 1 year ago
Codesignal has a fun Database “Arcade” <a href="https:&#x2F;&#x2F;app.codesignal.com&#x2F;arcade&#x2F;db" rel="nofollow">https:&#x2F;&#x2F;app.codesignal.com&#x2F;arcade&#x2F;db</a>
Cheezmeisterabout 1 year ago
Thanks for asking. Had a similar issue--no avenue to practice queries intentionally, outside of solving a real-world problem with all the confounding factors that entails.<p>Nice options ITT.
azraellzanellaabout 1 year ago
<a href="https:&#x2F;&#x2F;www.sqlzoo.net&#x2F;wiki&#x2F;SQL_Tutorial" rel="nofollow">https:&#x2F;&#x2F;www.sqlzoo.net&#x2F;wiki&#x2F;SQL_Tutorial</a>
jasonpeacockabout 1 year ago
A coworker used to solve Project Euler[1] problems using SQL while they waited for DB indexes to rebuild or tables to restore from backup in the middle of the night.<p>[1] <a href="https:&#x2F;&#x2F;projecteuler.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;projecteuler.net&#x2F;</a>
fuzztesterabout 1 year ago
UPDATE POSTS SET VOTE_COUNT = VOTE_COUNT + 1 WHERE POST_ID = CURRENT_POST_ID();<p>CREATE TABLE SQL_GAMES blah blah blah<p>INSERT INTO SQL_GAMES many invited users blah blah blah<p>SELECT * FROM SQL_GAMES WHERE users are having fun blah blah blah<p>PROFIT blah blah blah<p>ENJOY even more blah<p>-- TODO: drastically restructure above schema and SQL statements to make more sense blah blah blah<p>-- there&#x27;s your game blah blah blah
评论 #39568694 未加载