What is the structure of your database? What are some examples of entries?
How would you calculate this manually?
We need many more details.
BUT, if you are a student and this is homework of some kind, why don't you
try asking your peers, your teacher, or referring to your classroom
documentation? It would be cheating for us to just give you the answer.