Project 1: The Detective
In this project, you will step into the role of a detective investigating a crime committed in a fictional city. You have access to the city’s police database. Your goal is to find the murderer by following a trail of clues.
Scenario
Section titled “Scenario”A crime has occurred on Jan 15, 2023, in SQL City. You need to identify the murderer and, eventually, the mastermind behind the crime.
The Database Schema
Section titled “The Database Schema”The police database consists of several tables:
CrimeSceneReports: Descriptions of crimes, locations, and dates.Witnesses: Personal details of people who saw something.Interviews: Transcripts of what witnesses told the police.DriversLicenses: Details about cars and physical descriptions.GymMembers: Membership details for the “Get Fit Now” gym.
Investigation Steps
Section titled “Investigation Steps”-
Find the Crime Report
Start by searching theCrimeSceneReportstable for the specific date and city. This will give you the first set of clues about the witnesses. -
Locate the Witnesses
The report will likely mention where the witnesses live. Use theWitnessestable to find their names and IDs. -
Read the Transcripts
Join theWitnessestable with theInterviewstable. Look for the specific transcripts where the witnesses describe the killer. -
Identify the Suspect
The witnesses will provide physical clues (car plate, height, hair color) or membership clues (gym bag, check-in date). Join theDriversLicensesandGymMemberstables to narrow down your list. -
Find the Mastermind
Once you find the killer, read their interview transcript. It might lead you to the person who hired them.
Key Skills Required
Section titled “Key Skills Required”- Filtering: Identifying the correct date and city.
- JOINS: Connecting witness IDs to interview transcripts and gym records.
- String Matching: Searching for partial license plates or gym IDs.
The SQL Challenge
Section titled “The SQL Challenge”Example Starting Query
Section titled “Example Starting Query”SELECT descriptionFROM CrimeSceneReportsWHERE date = '20230115'AND city = 'SQL City'AND type = 'murder';Final Deliverable
Section titled “Final Deliverable”Your final answer should be a single SQL query that returns the name of the murderer. For a bonus, find the name of the woman who hired them by investigating the killer’s social circle and wealth.