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.