Bloomberg Interview Question

write sql queries for given problems