1. We cant give you the query for a home work. But we can guid you.
2. Provide us the create table script and insert script (test data)
3. Provide us the query what you tried so far. We will definitely guide you after that.

Anyway This link may help you. Provide the query in the forum even this post helped you, so that it will be helpful for other members facing the same issue.