01 April 2013

Time for the Q1 2013 Championship!

The first quarter of 2013 is now history. And that means....it's time for the next championship competition! It also means that we are fast approaching the 3rd anniversary of the PL/SQL Challenge, but I'll talk more about that in the next newsletter.

The following players will be invited to participate in the Q1 2013 championship. The number in parentheses after their names are the number of playoffs in which they have already participated.

See the FAQ for an explanation of the three ways a player can qualify for the playoff.

And congratulations to all listed below on their accomplishment and best of luck in the upcoming competition! Note that there are two first-time championship contestants....and two players have now reached their tenth championship!

We will announce the date for the championship as soon as players are invited and we confirm that a sufficient number can play on that date.

Name Rank Qualification Country
swart260 (3)1Top 25Netherlands
mentzel.iudith (9)2Top 25Israel
Stelios Vlasopoulos (6)3Top 25Belgium
Niels Hecker (10)4Top 25Germany
Justin Cave (8)5Top 25United States
Rakesh Dadhich (1)6Top 25India
Mike Pargeter (9)7Top 25United Kingdom
Vincent Malgrat (4)8Top 25French Republic
Siim Kask (9)9Top 25Estonia
puchtec (1)10Top 25Germany
Viacheslav Stepanov (8)11Top 25Russia
Janis Baiza (5)12Top 25Latvia
kowido (8)13Top 25No Country Set
Chad Lee (7)14Top 25United States
james su (5)15Top 25Canada
Frank Schrader (10)16Top 25Germany
Matthias Rogel (1)17Top 25Germany
Milibor Jovanovic (1)18Top 25United Kingdom
Jerry Bull (7)19Top 25United States
Randy Gettman (9)20Top 25United States
Ajaykumar Gupta (0)21Top 25Singapore
Dieter Kowalski (3)22Top 25Germany
Veera Marimuthu (0)23Top 25Singapore
Vinu (2)24Top 25India
Frank Schmitt (4)25Top 25Germany
Zoltan Fulop (4)26WildcardHungary
Jeroen Rutte (3)27WildcardNetherlands
Giedrius Deveikis (2)28WildcardLithuania
Ivan Blanarik (4)31CorrectnessSlovakia
macabre (3)55CorrectnessRussia
Kevan Gelling (7)59CorrectnessIsle of Man
dannyg64 (1)60CorrectnessUnited States
Rohan Gray (0)61WildcardUnited States
Michal Cvan (7)62CorrectnessSlovakia
Rimantas Adomauskas (2)64CorrectnessLithuania
Thierry Poels (4)92CorrectnessBelgium
Ingimundur Gudmundsson (0)125CorrectnessNorway
Carlos Eduardo Mayorga Rodriguez (2)137CorrectnessColombia
Dan Kiser (3)242CorrectnessUnited States

24 March 2013

Defining "the same results" for "unnecessary code" quizzes

The discussions around choice 4 of the 19 March quiz, in particularly those titled "Choice 4's commit is unnecessary" and 'The "last_name" column is unnecessary in Choice 4', made me realize that I need to offer a more explicit definition of what it means for two blogs to have the "same result."

Some players interpreted this to mean "same output displayed on the screen." Others engaged in a very deep analysis of whether or not the commit of a row is the "same" as an uncommitted row in a single session, etc.

Just like all of you, the players, I do not want to have debates on these sorts of issues after quizzes. I would much rather discuss the Oracle technology behind the quizzes.

So I am going to come up with a definition of the "same result" for these quizzes.

And I will start by first offering a definition or way to prove that two blocks do not have the same result.

I run the same code (let's call it T for test code) after each block (let's call them A and B). If T displays "A" after running the A block, and displays "B" after running the B block, then A and B do not have the "same result."

Expressed algebraically:

If A = B, then A + C = B + C.

And, conversely:

If A + C != B + C, then A != B.

Let's apply this rule to the following block:

BEGIN
   INSERT INTO plch_employees
        VALUES (1, 'Splog', 1000000);

   INSERT INTO plch_employees
        VALUES (200, 'Rogash', 1000000);

   COMMIT;
END;
/

Several players argued that COMMIT is unnecessary. I claim that it is necessary. I will now prove it using the proposed rule.

I run the following block immediately after the above block (call it A) and another without the commit (call it B):

DECLARE
   l_count INTEGER; 
BEGIN
   ROLLBACK;
 
   SELECT COUNT(*) into l_count
     FROM plch_employees;
 
   IF l_count = 2 
   THEN 
      DBMS_OUTPUT.PUT_LINE ('A');
   ELSE 
      DBMS_OUTPUT.PUT_LINE ('B');
   END IF;
END;
/

I will not see the same output displayed on the screen. Those two blocks, then, do not have the same result. The COMMIT is, therefore, necessary code.

This rule gives us all a way to demonstrate that two blocks are not the same. So if anyone claims that a certain chunk of code is not necessary, that claim can now be dis-proven objectively - as long as a block of test code can be devised.

Note that the rules state:

A change in the resources needed to execute the choice (CPU, memory, etc.) does not, for this quiz, constitute a change in the choice. In other words, if the removal results in a choice that is slower or consumes more memory, but otherwise accomplishes the same work (inserts a row, displays text, etc.), then the choice does contain unnecessary code.

So test code cannot display "A" vs "B" based on a "change in the resources" as defined in this rule.

Well, I will start with this rule and see what you all think.

05 March 2013

Feedback on "Unnecessary Code" Quiz Rules, Please

On 1 March, we offered a new type of daily PL/SQL quiz: Write No Unnecessary Code.

As often happens with new types of quizzes, players had lots of excellent feedback (including corrections) on how the quiz was presented.

Since we plan to offer at least another dozen quizzes of this type over the next year or so, we want to make sure that all future "unnecessary" quizzes are unambiguous and easy to understand.

Here is our current idea for how to define the quiz:

Each choice contains a combination of DDL statements and PL/SQL blocks. A choice is correct if it does not contain unnecessary code. A piece of code is unnecessary if you can remove it from the choice without changing the result of running the remaining code in that choice. 

Rules for this quiz:
  • You cannot add anything to the choice. You can only remove text - and there are limitations to what can be removed:
  • PL/SQL is composed of delimiters, identifiers and literals. Removal of part of a delimiter or literal is not allowed. You can, however, remove an  entire word (text separated by a delimiter or whitespace) from an identifier. Examples: you cannot remove "PLS_" from "PLS_INTEGER"; you cannot remove single quotes from around a literal string; you can remove "ZONE" from TIMESTAMP WITH TIME ZONE"(the result may be invalid code, but it would be a valid removal).
  • You cannot remove whitespace or comments. 
  • If it starts as a PL/SQL block, it must end that way. You cannot, in other words, remove BEGIN and END; and leave in place some part of the statements in the block as individual SQL statements.
  • A change in the resources needed to execute the choice (CPU, memory, etc.) does not, for this quiz, constitute a change in the choice. In other words, if the removal results in a choice that is slower or consumes more memory, but otherwise accomplishes the same work (inserts a row, displays text, etc.), then the choice does contain unnecessary code.
The following block, for example, contains unnecessary code and should be marked incorrect:
BEGIN
   NULL;
   DBMS_OUTPUT.PUT_LINE (1);
END;
After removing the NULL; statement, the block will do exactly the same thing it did before. But the  following choice should be marked correct, since if you remove the "NULL" or ";", the block will no longer be valid.

BEGIN
   NULL;
END;
I believe these rules clarify all issues raised in the Commentary for the 1 March quiz. What do you think? Are there other scenarios you have in mind that would not be addressed by these rules?

Thanks! Steven

08 February 2013

Results for Q4 2012 Championship

Thirty-two players competed in the Q4 2012 championship. This was our smoothest competition to date; only player experienced a minor problem and our reviewers did such a great job that no errors were found in our quizzes - a significant accomplishment given the complexity of the quizxes.

You will find below the rankings for the championship; the number next to the player's name is the number of times that player has participated in a championship.

Congratulations first and foremost to our top-ranked players:

1st Place: Stelios Vlasopoulos of Belgium wins: Amazon.com US$250 Gift Card.

2nd Place: kowido wins: Amazon.com US$175 Gift Card.

3rd Place: Chris Saxon of United Kingdom wins: Amazon.com US$100 Gift Card.


Stelios' victory is impressive in two ways: first, he submitted his answers in under 15 minutes, much faster than anyone else (and still achieved 100% correct). Second, he took first place in the Q3 2012 championship. That's quite a track record!

Congratulations to everyone who played in the playoff. I hope you found it entertaining, challenging and educational. And for those who were not able to participate in the championship, you can take the quizzes next week through the Practice feature.

Warm regards, Steven Feuerstein

Note 1: You may wonder how two players can achieve the same % correct and yet the player with the slower time is ranked ahead of a person with a faster time. This can happen due to the fact that the % correct is cumulative across all quizzes in the competition, but you receive a higher score for correct answers on advanced quizzes, compared to intermediate and beginner quizzes. This championship had 4 advanced quizzes and 1 intermediate quiz.

Note 2: Below the table of results for this championship, you will find another list showing the championship history of each of these players.

Rank Name Country Total Time % Correct Total Score
1Stelios Vlasopoulos (6)Belgium14 mins 56 secs100%3201
2kowido (8)No Country Set22 mins 49 secs96%2939
3Chris Saxon (5)United Kingdom22 mins 53 secs89%2677
4Frank Schrader (10)Germany28 mins 23 secs93%2677
5Frank Schmitt (4)Germany19 mins 20 secs89%2663
6mentzel.iudith (9)Israel34 mins 55 secs93%2587
7Dalibor Kovač (5)Croatia30 mins 45 secs89%2520
8Vincent Malgrat (4)French Republic26 mins 47 secs89%2514
9Niels Hecker (10)Germany24 mins 04 secs85%2504
10_tiki_4_ (4)Germany25 mins 59 secs81%2315
11Justin Cave (8)United States29 mins 42 secs85%2306
12Siim Kask (9)Estonia32 mins 14 secs85%2305
13Jeroen Rutte (3)Netherlands24 mins 44 secs81%2300
14Randy Gettman (9)United States27 mins 53 secs81%2237
15Rimantas Adomauskas (2)Lithuania30 mins 03 secs81%2194
16Dieter Kowalski (3)Germany32 mins 36 secs81%2193
17Michal Cvan (7)Slovakia30 mins 25 secs81%2187
18Jerry Bull (7)United States26 mins 11 secs74%2161
19Kevan Gelling (7)Isle of Man34 mins 57 secs81%2136
20Zoltan Fulop (4)Hungary31 mins 10 secs81%2127
21Krzysztof Helbin (2)Poland26 mins 39 secs74%2102
22Anil Jha (2)United States34 mins 54 secs81%2102
23Mike Pargeter (9)United Kingdom19 mins 52 secs70%2073
24Viacheslav Stepanov (8)Russia34 mins 08 secs78%2017
25Chad Lee (7)United States34 mins 00 secs78%1965
26Karel Prech (2)Czech Republic34 mins 43 secs78%1951
27Ivan Blanarik (4)Slovakia30 mins 20 secs74%1928
28swart260 (3)Netherlands30 mins 44 secs67%1665
29koko (2)Ukraine32 mins 24 secs67%1647
30Yuan Tschang (6)United States34 mins 55 secs59%1322
31mark kavalaris (2)No Country Set21 mins 39 secs44%1047
32Milibor Jovanovic (1)United Kingdom34 mins 34 secs37%609

Playoff Performance History

After each name, the quarter in which he or she played, and the ranking in that playoff.
Name History
Stelios VlasopoulosQ4 2010:38th, Q4 2011:22nd, Q1 2012:30th, Q2 2012:33rd, Q3 2012:1st, Q4 2012:1st
kowidoQ1 2011:26th, Q2 2011:9th, Q3 2011:17th, Q4 2011:21st, Q1 2012:4th, Q2 2012:1st, Q3 2012:9th, Q4 2012:2nd
Chris SaxonQ4 2010:16th, Q2 2011:2nd, Q4 2011:8th, Q3 2012:22nd, Q4 2012:3rd
Frank SchraderQ3 2010:12th, Q4 2010:30th, Q1 2011:1st, Q2 2011:5th, Q3 2011:1st, Q4 2011:1st, Q1 2012:13th, Q2 2012:3rd, Q3 2012:2nd, Q4 2012:4th
Frank SchmittQ4 2011:24th, Q2 2012:4th, Q3 2012:23rd, Q4 2012:5th
mentzel.iudithQ4 2010:4th, Q1 2011:18th, Q2 2011:25th, Q3 2011:6th, Q4 2011:5th, Q1 2012:8th, Q2 2012:19th, Q3 2012:35th, Q4 2012:6th
Dalibor KovačQ3 2010:16th, Q1 2011:25th, Q2 2011:15th, Q4 2011:17th, Q4 2012:7th
Vincent MalgratQ4 2011:10th, Q1 2012:15th, Q2 2012:16th, Q4 2012:8th
Niels HeckerQ2 2010:2nd, Q3 2010:1st, Q4 2010:15th, Q1 2011:7th, Q3 2011:8th, Q4 2011:11th, Q1 2012:2nd, Q2 2012:5th, Q3 2012:3rd, Q4 2012:9th
_tiki_4_Q4 2011:28th, Q1 2012:18th, Q2 2012:23rd, Q4 2012:10th
Justin CaveQ3 2010:26th, Q4 2010:3rd, Q1 2011:5th, Q3 2011:3rd, Q1 2012:25th, Q2 2012:2nd, Q3 2012:14th, Q4 2012:11th
Siim KaskQ1 2011:30th, Q2 2011:7th, Q3 2011:11th, Q4 2011:4th, Q1 2012:9th, Q2 2012:6th, Q3 2012:33rd, Q4 2012:12th
Jeroen RutteQ3 2010:20th, Q3 2012:12th, Q4 2012:13th
Randy GettmanQ3 2010:8th, Q1 2011:27th, Q2 2011:12th, Q3 2011:4th, Q4 2011:12th, Q1 2012:20th, Q2 2012:22nd, Q3 2012:32nd, Q4 2012:14th
Rimantas AdomauskasQ1 2012:23rd, Q4 2012:15th
Dieter KowalskiQ1 2012:21st, Q2 2012:8th, Q4 2012:16th
Michal CvanQ3 2010:23rd, Q4 2010:25th, Q3 2011:23rd, Q1 2012:12th, Q3 2012:16th, Q4 2012:17th
Jerry BullQ2 2011:34th, Q3 2011:9th, Q1 2012:14th, Q2 2012:14th, Q3 2012:15th, Q4 2012:18th
Kevan GellingQ2 2011:21st, Q3 2011:2nd, Q4 2011:7th, Q1 2012:7th, Q2 2012:25th, Q4 2012:19th
Zoltan FulopQ1 2012:17th, Q2 2012:29th, Q3 2012:24th, Q4 2012:20th
Krzysztof HelbinQ1 2012:11th, Q4 2012:21st
Anil JhaQ2 2012:31st, Q4 2012:22nd
Mike PargeterQ4 2010:22nd, Q1 2011:16th, Q2 2011:10th, Q4 2011:6th, Q1 2012:6th, Q2 2012:20th, Q3 2012:6th, Q4 2012:23rd
Viacheslav StepanovQ1 2011:9th, Q2 2011:4th, Q3 2011:14th, Q4 2011:20th, Q1 2012:19th, Q2 2012:12th, Q3 2012:7th, Q4 2012:24th
Chad LeeQ2 2011:28th, Q3 2011:19th, Q4 2011:13th, Q1 2012:1st, Q2 2012:26th, Q3 2012:30th, Q4 2012:25th
Karel PrechQ3 2012:38th, Q4 2012:26th
Ivan Blanarik Q1 2012:3rd, Q2 2012:15th, Q3 2012:18th, Q4 2012:27th
swart260Q2 2012:24th, Q3 2012:27th, Q4 2012:28th
kokoQ3 2012:40th, Q4 2012:29th
Yuan TschangQ2 2012:27th, Q3 2012:26th, Q4 2012:30th
mark kavalarisQ3 2012:39th, Q4 2012:31st
Milibor JovanovicQ4 2012:32nd

03 January 2013

Looking Back on 2012 and Ahead to 2013

11 December 2012

Jokes/Quotes About Programming Wanted!

We plan to add a little "reward" for your taking a quiz by offering you a programmer joke or quotation afterwards.

Do you know of any jokes about software, hardware, programming, etc.?

We'd love to use them on the site (as well quotes that you think would be of interest).

To submit a joke or quote, drill down to Quiz Details page for any quiz (through the Library).

Click on the Take Quiz Survey button.

Then click on the Submit Joke/Quote link.

We'll make it easier to submit these soon....

10 December 2012

Where/When Do Players Play?

Throughout November, a poll at the PL/SQL Challenge asked: "We've noticed that, at least for the daily PL/SQL quiz, the bulk of answers are submitted by approximately 16:00 UTC. That makes an awful lot of sense for Europeans, assuming they play the quiz at work. But it is surprising considering all the players in the Americas.  We can see when you play your quizzes, but it's far less clear where you take the quiz. Please tell us which of the following choices most closely reflects where and when you usually play your quizzes?"

178 players took the poll, and answered as follows:


Over 600 people answer a quiz through the course of a month, so this response covers roughly a quarter of all active players and likely is an accurate representation of the larger group.

As you can see, the vast majority of players answer quizzes during work hours (which I was glad to see!) and almost a third play during work time - hopefully with the support and blessing of their managers!