This is inmy opinion one of the best challenges of CS50! Very interesting, interactive and fun coding challenge. This my solution.
Things you should know before checking out the code:
Write SQL queries to solve a mystery.
A Mystery in Fiftyville The CS50 Duck has been stolen! The town of Fiftyville has called upon you to solve the mystery of the stolen duck. Authorities believe that the thief stole the duck and then, shortly afterwards, took a flight out of town with the help of an accomplice. Your goal is to identify:
Who the thief is, What city the thief escaped to, and Who the thief’s accomplice is who helped them escape All you know is that the theft took place on July 28, 2021 and that it took place on Humphrey Street.
How will you go about solving this mystery? The Fiftyville authorities have taken some of the town’s records from around the time of the theft and prepared a SQLite database for you, fiftyville.db, which contains tables of data from around the town. You can query that table using SQL SELECT queries to access the data of interest to you. Using just the information in the database, your task is to solve the mystery.