I have a "simple" situation here, but I couldn't resolve it by myself. So what I need is combine one result from the first query with the second one, to get a "final result".
The first query get the number of shots by player.
SELECT player, COUNT(shot) shots FROM table1 GROUP BY player;
+---------+-------+ | player | shots | +---------+-------+ | player1 | 10 | +---------+-------+ | player2 | 10 | +---------+-------+
The second is to get the hits.
SELECT player, COUNT(hit) hits FROM table2 GROUP BY player;
+---------+-------+ | player | hits | +---------+-------+ | player1 | 10 | +---------+-------+ | player2 | 5 | +---------+-------+
And what I need is to calculate the accuracy (hits / shots * 100), displaying the result something like that.
+---------+-------+------+-----+ | player | shots | hits | acc | +---------+-------+------+-----+ | player1 | 10 | 10 | 100 | +---------+-------+------+-----+ | player2 | 10 | 5 | 50 | +---------+-------+------+-----+