This looks like homework, which we don't do for you. The point is that you learn by trying.
There is not enough information here to help in any case ... we cannot see your example database for example.
Post what you have tried so far and explain what your problem is.
There is some excellent advice on how to ask questions to get the best response at this link
what have you tried[
^]