John Deere Interview Question

sql query linked list ques