Skip to content

Instantly share code, notes, and snippets.

View maartenterpstra's full-sized avatar

Maarten Terpstra maartenterpstra

View GitHub Profile
@maartenterpstra
maartenterpstra / solution.sql
Created December 16, 2019 13:53
Solution to SQL Murder Mystery
-- The solution to the murder mystery on https://mystery.knightlab.com/
-- The story:
-- A crime has taken place and the detective needs your help. The detective gave you the crime scene report, but you somehow lost it. You vaguely remember that the crime was a ​murder​ that occurred sometime on ​Jan.15, 2018​ and that it took place in ​SQL City​. Start by retrieving the corresponding crime scene report from the police department’s database.
SELECT description
FROM crime_scene_report
where date = 20180115 and city = 'SQL City' and type = 'murder';
-- Security footage shows that there were 2 witnesses.
-- The first witness lives at the last house on "Northwestern Dr".