SQL for Smarties