PTC interview question

DSA,Oops(Mostly in Java) Some SQL Queries Puzzles