Fidelity Investments interview question

SQL queries to write.