summaryrefslogtreecommitdiff
path: root/wk7/pset/fiftyville
diff options
context:
space:
mode:
Diffstat (limited to 'wk7/pset/fiftyville')
-rw-r--r--wk7/pset/fiftyville/answers.txt2
-rw-r--r--wk7/pset/fiftyville/log.sql24
2 files changed, 24 insertions, 2 deletions
diff --git a/wk7/pset/fiftyville/answers.txt b/wk7/pset/fiftyville/answers.txt
index c2af8c3..ea760c3 100644
--- a/wk7/pset/fiftyville/answers.txt
+++ b/wk7/pset/fiftyville/answers.txt
@@ -1,3 +1,3 @@
The THIEF is: Bruce
The city the thief ESCAPED TO: New York City
-The ACCOMPLICE is:
+The ACCOMPLICE is: Robin
diff --git a/wk7/pset/fiftyville/log.sql b/wk7/pset/fiftyville/log.sql
index e7b97e6..b1fe3e5 100644
--- a/wk7/pset/fiftyville/log.sql
+++ b/wk7/pset/fiftyville/log.sql
@@ -173,6 +173,7 @@ AND id IN (
;
-- BRUCE is the thief
+-- Get phone number of accomplice
SELECT receiver
FROM phone_calls
WHERE caller = (
@@ -183,6 +184,27 @@ WHERE caller = (
AND year = 2023
AND month = 7
AND day = 28
-AND duration = 10
+AND duration < 60
;
+-- "(375) 555-8161"
+-- Get name of accomplice from their phone number
+SELECT name
+FROM people
+WHERE phone_number = (
+ SELECT receiver
+ FROM phone_calls
+ WHERE caller = (
+ SELECT phone_number
+ FROM people
+ WHERE name = "Bruce"
+ )
+ AND year = 2023
+ AND month = 7
+ AND day = 28
+ AND duration < 60
+)
+;
+-- ROBIN is the accomplice
+
+-- :3 Miau