Pergunta de entrevista da empresa Honeywell

SQL queries two pointer question for a linked list