Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

The Obfuscated SQL Contest at the PL/SQL Challenge

Steven Feuerstein-OracleMar 20 2015 — edited Mar 20 2015

For those of you who do not know about, the PL/SQL Challenge (plsqlchallenge.com) is a website that offers weekly and monthly quizzes on SQL, PL/SQL, Database Design and Logic.

Reading doc (and discussion threads and books and ...) and watching videos are relatively passive ways of learning. Taking a quiz directly tests your knowledge, exposing areas that need more attention and reinforcing expertise you already have.

So I encourage you to sign up at plsqlchallenge.com and give it a try.

But I write today with a specific and unusual "challenge": as a complement to our weekly "serious" quizzes, Chris Saxon, Oracle Developer Advocate for SQL and the Database Design quizmaster, has launched the Obfuscated SQL Contest.

Here's the description from the site:

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


We've already gotten some really hard-to-understand submissions. Can you do WORSE? :-) And, sure, this is a discussion forum, so I suppose you could simply answer this post with your solution. But then you will not be in the competition for winner of the VERY WORST solution.


plsqlchallenge.com

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 17 2015
Added on Mar 20 2015
1 comment
829 views