Bytecode IO interview question

How to solve an SQL problem.