Pergunta de entrevista da empresa IBM

Advance Java based questions, SQL query