Re: SQL Fun
Posted in 2007
Art S. Kagel wrote:
> bozon wrote:
>
>> I was thinking about this the other day and I created some "amusing"
>> examples. Technically SQL has no reserved words so you can create some
>> abdominal SQL. Of course in reality some of them don't work or don't
>> work all of the time so here are some examples of some really bad
>> things to do. All of these statements work except one. Can you tell
>> which one without actually running them? I can't. (all rights reserved
>> ;-) )
>>
>> create table select(
>> serial serial,
>> create int,
>> table int,
>> order int,
>> select int,
>> from int,
>> where int,
>> and int,
>> or int,
>> insert int,
>> update int,
>> in int,
>> int int,
>> delete int,
>> drop int,
>> into int,
>> set int
>> ) ;
>> insert into select (
>> serial, create, table, order, select,
>> from, where, and, or, insert,
>> update, in, int, delete, drop,
>> into, set
>> )
>> values (
>> 0, 1, 2, 3, 4,
>> 5, 6, 7, 8, 9,
>> 10, 11, 12, 13, 14,
>> 15, 16
>> ) ;>>
>> select select from select;>>
>> select from from select where and = 5 and or = 7 ;>>
>> delete from select where where = 10 and and = 20 ;>>
>> delete from select where into = 5;>>
>> update select set set = 20 where where = 5 and order = 7 and drop = 8
>> and and = 2 ;>>
>> select or, and, update from select where and = 6 and or = and ;>>
>> select or, and, from from from select ;>>
>> select or and, and or, from from select ;
>>
>> select or select, and where, from from select;
>>
> Actual testing shows only 'select or and, and or, from from select ;'
> fails with a syntax error.
>
> I like this anagram:
PALINDROME PALINDROME PALINDROME PALINDROME PALINDROME PALINDROME PALINDROME
Sorry not enough coffee this AM.
Art S. Kagel
> select from where from select;
>
> How many anagram queries can you create from this table's schema?
>
> Art S. Kagel