Morgan Stanley interview question

You have a database and then write a query for some specific task.