PwC interview question

on java and sql queries