PTC interview question

Mostly about java and dbms queries