Bytecode IO Interview Question

How to solve an SQL problem.