Capgemini interview question

Few tricky SQL queries