Live data from Hacker News

SQL Murder Mystery

mystery.knightlab.com

41–50 of 82 posts

Re: SQL Murder Mystery

#41
post #37

I always wanted do invest my 20 hrs into SQL. I've already put 10 with a data analyst course so i know what a sqlite , select and joins are. I've created a not trivial query once. Is this OK for learn some more ?

Sure thing. I think learning SQL is never wasted time. Try looking into SQL functions & TRIGGERs, LATERAL JOINs, ROLLUP & CUBE. If you have even more time, check out the different things an SQL server can do when you DROP a row that contains references, how you define CONSTRAINTs, and some particular features that only some subset of SQL dialects have, such as LISTEN/NOTIFY for PostgreSQL.

>Try looking into SQL functions & TRIGGERs, LATERAL JOINs, ROLLUP & CUBE.

If you're a developer, I would look into CONSTRAINTS way before getting to anything like this. Learning how to model your constraints correctly in the database (preventing duplicates, etc) is one of the most important bits of schema design because it will save you tons of code and likely a bunch of race conditions.

Re: SQL Murder Mystery

#43
post #37

I always wanted do invest my 20 hrs into SQL. I've already put 10 with a data analyst course so i know what a sqlite , select and joins are. I've created a not trivial query once. Is this OK for learn some more ?

Sure thing. I think learning SQL is never wasted time. Try looking into SQL functions & TRIGGERs, LATERAL JOINs, ROLLUP & CUBE. If you have even more time, check out the different things an SQL server can do when you DROP a row that contains references, how you define CONSTRAINTs, and some particular features that only some subset of SQL dialects have, such as LISTEN/NOTIFY for PostgreSQL.

Knowledge is power and knowing more deeply about what your database is capable of is very helpful. It's worth knowing every tool in your tool chest!

That said, be careful with going too overboard with one specific tool (SQL). You may find yourself using a hammer for everything, when another tool may be more appropriate.

More specifically, it's easy to abuse advanced SQL constructs to create a mess for yourself. Too much business logic in the database is something I've seen become a nightmare for other programmers looking at software later. :)

This post[0] goes a bit into more detail about explaining where you should keep your "business logic" when choosing to put it in code or into SQL.

0: https://softwareengineering.stackexchange.com/questions/1944...

Re: SQL Murder Mystery

#45

I always wanted do invest my 20 hrs into SQL. I've already put 10 with a data analyst course so i know what a sqlite , select and joins are. I've created a not trivial query once. Is this OK for learn some more ?

Yes, I think it's very useful. There are lots of things that SQL can do that are being done by code right now because the developers don't know any better.

Re: SQL Murder Mystery

#49
I've never come across an "SQL game" before, this was great fun!

I got it in around 15 minutes though, really wish there was a bit more too it, or that more complex queries were required.

Re: SQL Murder Mystery

#50
Ah, fond memories :) I once made a javascript implementation of an sql engine for a weekend game.

http://ludumdare.com/compo/ludum-dare-27/?action=preview&uid...

It was a very long time ago and, then, everyone was wondering where Snowden was. I think this was after he was identified, and just before he ended up in Russia.

Anyway, you are given an NSA Prism terminal, complete with Windows 95 look and feel and a paperclip.

You have to use your leet SQL skills to find out what flight he was on, and then book your agents onto intercepting flights.

Because it was all client-side javascript, and hosted on github pages, its still playable all these years later:

http://williame.github.io/ludum_dare_27_snowden/index.html

Of course it was a complete flop!

But making an sql engine under that kind of time pressure was pretty intense.

https://williamedwardscoder.tumblr.com/post/59997353762/runn...

Hard to believe that whole Snowden thing was 6 years ago now!?

Post reply on HN