Apr 242015

In celebration of my trip to Vegas last week, here’s clues to card games in SQL form:

-- Q 1
select surname || first_name
from   actors
where  films in (
  'Kung Fu Panda',
  'Nacho Libre',
  'King Kong'

-- Q 2
select description
from   dishonest_act;

-- Q 3
select (select name 
        from   elements 
        where atomic_number = 79) || 
       (em / 2)
from   hinged_barrier;

-- Q 4
select replace(name, chr(107), chr(116))
from   cooking_utensils
where  purpose = 'beating eggs';

-- Q 5
select listagg(ingredients, ' ') 
         within group (order by ingredients) ||
       (select word
        from   scrabble
        where  letters = 2
        and    points = 7)
from   cocktails
where  name = (
  select name
  from   music_styles
  where  period between 1600 and 1750

-- Q 6
select max(name), min(name)
from   cities
where  county = (select capital
                 from   isle_of_man);

There’s some tough ones this time around; bonus points to anyone who gets them all ;)

As always, put your answers in the comments.

Mar 302015

The following SQL statements are all clues to the names of trees:

select covering
from   mammals;

update wood
set    state = 'burnt';

select admiration
from   people
select name
from   pronouns
where  type = 'second person';

select target
from   diseases
where  nationality = 'Dutch';

update oslo
set    appearance = 'smarter';

select *
from   elements e
join   punishments p
where  e.atomic_number = 47
and    p.type = 'beating';

Can you guess them all? Put your answers in the comments :)

Feb 152015

Here’s another six SQL brainteasers. This time the SQL is a clue to the power(s) of a superhero. Who is each superhero?

insert into body (skeleton)
values ('adamantium');

update person
set    strength = 'superhuman'
where  emotion = 'anger';

delete from powers
where  location = 'near Kryptonite';

update body
set    exoskeleton = 'ferrous material';

select *
from   women
where  equipment = 'noosed rope of veracity';

  insert into boy (mouth)
  values ('Musa × paradisiaca');

  update boy 
  set    strength = '20 men',
         power = 'flight';

As always, put your answers in the comments!

Jan 172015

Some more SQL clues, this time to chocolate bars.

select iso_code
from   countries
where  capital_city = 'Taipei'
and    9 = roman;

select *
from   planets
where  position = 4;

select characters
from   thundercats
where  age = 'prepubescent';

select *
from   ships
where  crew = 'mutinous';

select *
from   cities
where  that_is = 'Eboracum';

select min(volume)
from   speech;

When you’ve got them, put your answers in the comments!

Dec 312014

Another batch of SQL brainteasers. This time the clues are to the powers of mythical creatures – the task is to guess the creature!

There’s six in all, can you get them all? Put your answers in the comments!

update target_of_gaze
set    state = 'stone';

  delete from creature
  where  appendage = 'head';

  insert into creature (appendage)
  values ('head');

  insert into creature (appendage)
  values ('head');

update bird
set    state = 'alive'
where  state = 'burning';

select *
from   women
where  singing = 'deadly';

update creature
set    body = 'furry'
where  moon = 'full';

select *
from   men
where  powers in (
  'conferring playthings',
  'determining moral terpitude'
Nov 072014

Continuing the nation theme, here’s another six SQL clues to countries. Can you get them all?

select first_person
from   roman_eleven
where  business = 'abbreviated';

select aquatic_limb
from   places;

select *
from   dinner
where  contents in ('beef', 'kidney beans');

select character
from   films
where  actor = 'Tom Green';

select unrepeatable_position
from   flightless_birds
where  allegiance = 'Confederate';

select fortification
from   wine
where  second_person = 'female';

As always, put your answers in the comments!

Oct 192014

Same concept, different theme. All the SQL statements below are clues to the English spelling of countries.

Can you get them all?

As always, put your answers in the comments!

select *
from   german_affirmative
join   cooking_vessel;

select *
from   nuts
where  anaphylaxis = 'sexually transmitted';

select *
from   olde_english_the
join   males;

select *
from   elements
where  atomic_number = 47;

select *
from   programming_languages
where  able_to = 'influence PL/SQL';

select *
from   places
where  H2O = 'frozen';
Mar 212014

Back on the films today, here’s another six to get:

select talk
from   monarch;

select * 
from   (select city_name
        from   cities
        where  state = 'IL'
        order  by population desc)
where  rownum = 1;

select * 
from   nations
where  not exists (
         select null
         from   people
         where  status = 'retired'
         and    sex = 'male'
         and    p.location = n.location

sqlplus -s young_ovis_aries

select key
from   injury;

select *
from   human_property
where  duration between date '2000-01-01'
                and date '2012-12-31';

Finally, there’s something that links all the above films. Can you get it?

Put your answers in the comments!

Feb 212014

Back on the film quizzes this time with a mathematical twist for the clues:

select count(*) 
from   days_of_the_week;

select * 
from   cerebrum
where  power(e, i * pi) + 1 = 0;

select * 
from   direction_finder
where  length = (1 + sqrt(5)) / 2;

select * 
from   shape
where  height = width
and    width = depth;

select *
from   frankensteins_possesions
where  (x * x) + (y * y) + (z * z) = (r * r);

select *
from   unknown_people
where  E = m * c * c;

Can you guess all six? Put your answers in the comments!

Jan 242014

I’ve not been too well recently, so to “celebrate” here’s six SQL clues to various diseases. Can you get them all? Put your answers in the comments!

select *
from   domestic_fowl
join   pimply_rash;

select * 
from   body_parts
where  description in (
   'glove filler', 
   'walking attachment', 
   'food opening'

select max(temperature)
from   colours
where  hue = '#FFFF00';

select *
from   people
where  sex = 'Male'
and    location in (
    select name
    from   theatre_arts_academies
    where  location = 'Russia'

select *
from   arcane_programming_language;

select *
from   maldive_islands
where  location = 'southern most'
and    colour = '#00FF00';