NCS Interview Question

How to optimise an sql query