We've been offering quizzes on the PL/SQL Challenge (and now the new Oracle Dev Gym - still in an "early adaptor" user testing phase) since April 2010. We've covered hundreds of topics in PL/SQL, and hundreds more in SQL. Most quizzes are multiple choice, and one of my favorite question style is to ask: what code in my program unit is unnecessary? By "unnecessary" we mean that the code can be removed without affecting the behavior of the program unit. There can be two reasons, roughly, for a chunk of code to be unnecessary: 1. The code "reinforces" or explicitly defines default behavior. If you remove it, the default comes into play. So no harm done, but it is often beneficial to be explicit. 2. You misunderstand how the language works and therefore write code that should not be there at all, and is likely to cause maintenance issues later (and maybe even lead to bugs). I offer an exercise below in identifying unnecessary code. See if you...
For the last twenty years, I have managed to transform an obsession with PL/SQL into a paying job. How cool is that?