This seems quite simple like homework stuff
Can you let us know what you have tried?
If you are stuck somewhere, we are happy to help you.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/