My question is about percentages, I'm not an expert so I will try to explain in the better possible way.
I have a table with, let say 700 records, in my mysql server, something like this
+-------+---------+----------+-------+
| Name | country | language | Birth |
+-------+---------+----------+-------+
| Lucy | UK | EN | 1980 |
| Mari | Canada | FR | 1990 |
| Gary | Canada | EN | 1982 |
| Stacy | Jamaica | EN | 1986 |
| Joao | Brasil | PT | 1984 |
+-------+---------+----------+-------+
So I query all the records that are between 1980 and 1985 and the result will be:
+------+---------+----------+-------+
| Name | country | language | Birth |
+------+---------+----------+-------+
| Lucy | UK | EN | 1980 |
| Gary | Canada | EN | 1982 |
| Joao | Brasil | PT | 1984 |
+------+---------+----------+-------+
and from this result I would like to obtain:
the percentage of appearance of every languages between those years
EN = 75% (3 is the total in this case) PT = 25%
the percentage of appearance of every country that is seen in the resulting table
UK = 33% Canada = 33% Brasil = 33%
I mean how can I convert the results in variables to use them in the final function.