Mysql Database Interview Query