I'm using a chess dataset that uses two tables to calculate the percentage of players from each country with a FIDE of over 1800. One table already has a column with the total players in each country. So if I use this query:
SELECT Country, Total_Players
FROM international_ranking;
It'll list every country with the corresponding total number of players.
The other table is just a collection of player names(with a corresponding FIDE and country). So when I use this query:
SELECT Country, count(FIDE)
FROM chess_players
WHERE FIDE >= 1800
GROUP BY Country;
It'll give me each country with the count of players having a score of atleast 1800.
Now, how do I combine these statements to calculate the percentage(count(FIDE)/Total_Players) for each country?