Craftner interview question

SQL queries and performance tuning