This is quite basic stuff. I'd suggest reading some
SQL tutorial and then trying to write the query yourself. If I understand your problem correctly, you'll need to utilize
select,
inner join and a
group by (these keywords might help you find the relevant parts of the tutorial sooner).
If you get stuck, post here what you've tried. We'll be glad to help you, but we're
NotACodeMill (⇐ click).