11 May 2015

Obfuscated SQL Contest Winners!

Chris Saxon and Kim Berg Hansen collaborated to offer an Obfuscated SQL Contest:

Daylight savings changes are coming in across the world! Scheduling meetings with colleagues across the globe is always a challenge. With different countries switching on different dates (and some not switching at all!) through March this is even harder. To help us navigate this, we'd like a SQL query that returns the current date and time for different timezones. There is, however, a twist. We don't want plain or boring or readable SQL.

We want the most ingenious, creative, quirky and downright weird SQL you can muster to perform this task.

And thus begins the Obfuscated SQL Contest.

The challenge: 

Write a single SQL statement that returns the current date and time for all the following locations:
Bangalore, London, New York, Chicago and Denver.

The rules:
  • The output must match this format (all on one line):
BAN - DD-MON-YYYY HH24:MI:SS; LON - DD-MON-YYYY HH24:MI:SS; NEW - DD-MON-YYYY HH24:MI:SS; CHI - DD-MON-YYYY HH24:MI:SS; DEN - DD-MON-YYYY HH24:MI:SS
  • Maximum length the SQL statement can be is 4,000 characters (after removing unnecessary whitespace)
  • Supply the minimum version of Oracle required to execute the query and (if relevant) the maximum
  • You cannot create any additional objects yourself. However you can use any objects supplied with the default installation of Oracle Enterprise Edition
The judging panel will pick a winner or winners based on the following criteria:

  • Using little-known or rarely-used features of Oracle
  • Exploiting features for something other than their intended purpose
  • Making use of multiple features within a single query
  • Quirky, funny or otherwise ingenious SQL code
53 players submitted some crazy SQL, and Chris and Kim have selected the winner and runners-up:

Overall winner: Stelios Vlasopoulos
Runner up: Sean Stuber
Runner up: James Su

Thanks to everyone for participating in this contest. We hope to do more in the future.

Check out all the details here