Chatham Financial Interview Question

SQL query for selecting particular records.