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:

  1. a guy living in the same neighbourhood (extract the zip code from the previous result)

  2. look up when the zodiac sign Aries is online

  3. look up when the year of the Dog is in the past 80 years (guy should be alive)

  4. 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.