Show HN: SQL Noir – Learn SQL by solving crimes

463 pointsposted 7 months ago
by chrisBHappy

14 Comments

RvdV

7 months ago

I like it! Very fun! Few ideas:

- The "submit" box isn't clear on whether it needs the name or the suspect id for the first case

- It would be nice to have a "copy to notes" button in the output

- It would be nice to have some docs on what functions are available / which dialect this is.

I think this very valuable, it's so much more easy to learn if you actually have a small project to work on

worble

7 months ago

This is super fun!

One small thing which would be nice is the ability to just download the sqlite database myself so I could use my preferred application to query it, and just use the site for the brief, notes and submission.

Also a nitpick, while you say it's for "learning" SQL, I would probably expect something a little more guided, or at least some example queries, if the intention was to teach SQL. As it stands, if you don't know SQL you're probably going be completely lost as to what you should be doing. It's really cool, just not specifically as a learning tool.

laowantong

7 months ago

A great addition to a field where there aren't many offerings: SQL Island (https://sql-island.informatik.uni-kl.de) and SQL Murder Mystery (https://mystery.knightlab.com) come to mind. The mechanism of SQL Noir is close to that of the latter, i.e., an undirected, essentially standalone adventure. I myself am working on SQLab, a SQL game engine that allows you to augment an arbitrary base with exercises on that base to produce directed, standalone adventures: https://github.com/laowantong/sqlab. You download a dump of the database (currently MySQL, SQLite, Postgres), and can play under any administrator interface. On the same page there's a link to the long police investigation I designed for my (French) students. If you're a teacher or researcher in the field, the principles of SQLab are explained here: https://arxiv.org/abs/2410.16120.

wbakst

7 months ago

Love this! The style is unique and awesome.

I see the beginnings of a really fun way to learn / practice / remember SQL.

A few notes:

- Would be cool if it was a single workspace (no tabs). Was constantly switching tabs back and forth.

- Saving previous SQL queries and results would be cool. I was copying results into the notes. Feel like this is important as things get more complex.

Excited to see where you take this!

fodkodrasz

7 months ago

The idea is good, but the UI is all but immersive.

Things that would it make more immersive:

- autocomplete

- and/or the ability to view the schema alongside the query (on a wide enough screen)

- a way to copy table and column names easily with a click (table names cannot be selected at all!)

- ability to just add more queryies under/over the already executed ones, instead of only being able to replace them.

8mobile

7 months ago

Wow what a great idea, I had fun solving the cases. I think maybe a comic version would help junior programmers. The SQL editor sometimes behaves strangely and does not allow correct writing. Thanks

kaeruct

7 months ago

The editor behaves weirdly when I try to add comments.

It's hard to explain, but you can reproduce like this:

1. Write several lines, for example:

  select i.*, s.*
  from interviews i
  join suspects s
  on s.id = i.suspect_id

2. Try to comment each line on its own by typing -- in front of each line.

  -- select i.*, s.*
  from interviews i
  join suspects s
  on s.id = i.suspect_id



  -- select i.*, s.*
  -- from interviews i
  join suspects s
  on s.id = i.suspect_id

3. As soon as you do it for "from interviews i", that line will move itself to the previous line, and the syntax highlighting will be broken

doruk101

7 months ago

When I was in university, my instructor linked something like this for SQL practice (a crime solving minigame, just like this one).

I remember getting really into it, even going to the extreme of trying to find the most efficient one-liner solution.

Thanks for making this. I’ll be passing the torch by linking it to anyone interested in learning SQL.

chocks

7 months ago

This is pretty fun, I tried the two free mysteries and was fun solving them. One nit, would be nice if the SQL editor supported comments so we can comment out old queries before running new one so as keeping a history esp if we need to run the same queries again. Good stuff :)

ryanianian

7 months ago

Really cute. But I really want the ability to put the different tabs -- Brief, Workspace, Schema -- side-by-side. I know SQL and wanted to play with this, but the UX was frustrating enough to drive me away, even though it is really pretty.

deanebarker

7 months ago

This is really lovely. It makes me happy that you invested time into building this for other people.

Factory

7 months ago

On case #4: select * from phone_records where caller_id= 11 or recipient_id = 11

The results header is screwed up, there is an extra 'id' column. At least on firefox.