GIPL interview question

How to implement the performance of the SQL query