as previous posters have said you haven't shown what you've tried with
1. SQL code
2. a narrative as you feel that you need help approaching the problem
as it does show that you have a lack of understanding you need to do some research / learning into the subject. buy some books / get some training or even use the internet and look up examples
here's a potential site to start learning from
learn a bit of SQL