Some Christmastime Database Humor

And who doesn’t love some database humor at Christmas? A few days ago, @withoutgorms posted this tweet:

He’s making a database,
He’s filtering twice
SELECT * FROM customers WHERE
behaviour = Nice
Santa Clause is Coming to town.

When this was shared with our Business Intelligence Analyst, he had the following reply:

This is followed by Santa swearing loudly because some of the children have no primary address marked, while others have multiples. The zip code field allows letters which breaks his WHERE clauses (see what I did there) that use integers. Anyone with a Naughty date prior to 5/19/2004 is automatically set to that date and he can’t see exactly how long they’ve been naughty. His Naughty Reasons table only allows 1 very poorly defined reason per child, and their Naughty record is deleted if they ever become Nice again. Figuring out how to see the behavior that Referred the child to the Nice list requires joining 7 different tables across multiple databases that have the same fields named differently, and his stupid elves have added dummy children to the production databases for testing purposes and have neglected to remove them. Poor Santa.

It’s ok. You can laugh AND cry. We do.