From 7e6c6583a9481a72f35db1edf6e686214288a477 Mon Sep 17 00:00:00 2001 From: bot50 Date: Tue, 21 Apr 2026 07:29:50 +0000 Subject: [PATCH] daviddoji-cs50/problems/2024/sql/packages@20260421T072950.296318251Z --- answers.txt | 9 +++++++++ log.sql | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 answers.txt create mode 100644 log.sql diff --git a/answers.txt b/answers.txt new file mode 100644 index 0000000..63a56f0 --- /dev/null +++ b/answers.txt @@ -0,0 +1,9 @@ + +At what type of address did the Lost Letter end up?: Residential +At what address did the Lost Letter end up?: 2 Finnigan Street + +At what type of address did the Devious Delivery end up?: Police station +What were the contents of the Devious Delivery?: Duck debugger + +What are the contents of the Forgotten Gift?: +Who has the Forgotten Gift?: diff --git a/log.sql b/log.sql new file mode 100644 index 0000000..9f4a9c0 --- /dev/null +++ b/log.sql @@ -0,0 +1,23 @@ + +-- *** The Lost Letter *** +-- Get the address id of sender ==> id 432, type Residential +SELECT * FROM "addresses" WHERE "address" = "900 Somerville Avenue"; + +-- Get the address id of receiver ==> id 854, type Residential +SELECT * FROM "addresses" WHERE "address" LIKE "2 Fin%Street"; + +-- Get the id and contents from the parcel send by sender to receiver +SELECT * FROM "packages" WHERE "from_address_id" = 432 AND "to_address_id" = 854; + +-- *** The Devious Delivery *** +-- Get the delivery address of the parcel with missing "from_address_id" +SELECT * FROM "packages" WHERE "from_address_id" IS NULL; + +-- Get info about the package +SELECT * FROM "scans" WHERE "package_id" = 5098; + +-- Get info about where the parcel ended up +SELECT * FROM "addresses" WHERE "id" = 348; + +-- *** The Forgotten Gift *** +