Hanukkah of Data 2022: Puzzle 3
Similar to the Advent of Code, the Hanukkah of Data (archive) was released in December 2022.
I don’t have time to do that during the holidays, so January 2023 it is for me.
1. Plan of attack
I’m looking for:
-
a guy living in the same neighbourhood (extract the zip code from the previous result)
-
look up when the zodiac sign Aries is online
-
look up when the year of the Dog is in the past 80 years (guy should be alive)
-
filter people by location and birthday
2. Implementation
This time, everything should be doable in SQL right away via DBeaver:
select
distinct name,
phone
from
customers c
where
strftime('%Y', c.birthdate) in ('1958', '1970', '1982', '1994', '2006')
and strftime('%md', c.birthdate) between '0321' and '0419'
and citystatezip like '%NY 11420%' -- same neighbourhood as the contractor
order by
name;
3. Result
Only 1 result is returned, and it’s the right one.
Time to solve: 20 minutes.