Knights plc interview question

How to optimise an sql query?