Adyen interview question

How to efficientize data retrieval from SQL tables.