Welcome to SO. Unfortunately your question is not specific enough to get any help. What have you got so far, what do you want to achieve, what programming language do you want to use, how shall the output be generated etc. etc.
If all that makes no sense to you, you might want to learn MySQL from the beginnings. The key words are “select” and “join”.
Once you can generate the result you need, MySQLAdmin/ PhpMyAdmin offers some “export to excel” functionality.