3CLogic interview question

MySQL queries