Thursday, January 4, 2024

Another Holiday Puzzle - Hanukkah of Data - Part 3

Hanakkuh of Data

A database puzzle


** WARNING: SPOILERS AHEAD **

** DAY 3 - THE NEIGHBOR **

Sarah and the investigator were very impressed with your data skills, as you were able to figure out the phone number of the contractor. They called up the cleaning contractor straight away and asked about the rug.

"Oh, yeah, I did some special projects for them a few years ago. I remember that rug unfortunately. I managed to clean one section, which revealed a giant spider that startled me whenever I tried to work on it.

"I already had a fear of spiders before this, but this spider was so realistic that I had a hard time making any more progress. I kept expecting the cleaners would call for the rug, but they never did. I felt so bad about it, I couldn't face them, and of course they never gave me another project.

"At last I couldn't deal with the rug taking up my whole bathtub, so I gave it to this guy who lived in my neighborhood. He said that he was naturally intuitive because he was a Cancer born in the year of the Rabbit, so maybe he was able to clean it.

"I don't remember his name. Last time I saw him, he was leaving the subway and carrying a bag from Noah's. I swore I saw a spider on his hat."

Can you find the phone number of the person that the contractor gave the rug to?

For this one, we'll need to use a piece of data from our previous query. We need to know what neighborhood the Contractor lived in. We also need to figure out this person's astrological birthdate. Time for more Google-fu.

What we know:

  1. Lived in the Neighborhood
  2. Is a Cancer born in the Year of the Rabbit
  3. The Contractor's address is:"100-75 148th St, Jamaica, NY 11435"

Cancer born in Year of the Rabbit.

  • June 21 - July 22 (https://www.google.com/search?q=cancer+dates+zodiac)
  • The Year of the Rabbit occurs every 12 years in the Chinese zodiac, and the next one will be in 2023.
    • Other recent Years of the Rabbit include 1915, 1927, 1939, 1951, 1963, 1975, 1987, and 1999.
    • ( https://en.wikipedia.org/wiki/Rabbit_(zodiac) )

So then we just combine these filters:

    SELECT customerid, name, address, citystatezip, birthdate, phone
    FROM customers c
    WHERE YEAR(birthdate) IN (1915,1927,1939,1951,1963,1975,1987,1999,2011)
        AND (
            ( MONTH(birthdate) = 6 AND DAY(birthdate) >= 21 )
            OR
            ( MONTH(birthdate) = 7 AND DAY(birthdate) <= 22 )
        )
        AND zip = 11435

    /*
    customerid  name           address          citystatezip       birthdate   phone
    2550        Robert Morton  145-51 107th Ave Jamaica, NY 11435  1999-07-08  917-288-9635
    */

This one wasn't that difficult, but there are probably prettier ways to get at this birthdate.





GO TO DAY 4

BACK TO PART 1
BACK TO PART 2

No comments:

Post a Comment