Comparing MySQL tables

I have two MySQL tables which I need to compare and then order.

One group of people choose their 5 favourite things which go into table A. Another group choose their 5 favourite things from a list of all the answers given in table A. The results of which go into table B.

So table A and B will have all the same values just with different frequencies.

What I want to be able to do is rank Table A depending on how popular each of the values in table B are.

i.e If person1 chose their favourite 5 things (stored in table A) as cat, dog, sheep, pig, cow and the most popular choices in table B were cat, dog, sheep, pig, cow then person1 would be at the top. If person1 chose all the unpopular values in table B then they would be at the bottom.

I hope this makes sense!!! Any help would be greatly appreciated. Thank you.

Please do not double post