Assume there are 261 nations, 7 religions, and 393 entries in the Religions
table. The world population is ~5.99 billion. There are 190
Christain nations. Suppose I want to know the number of people of
various faiths. What would these querries produce?
select sum(pop), religion from Religions, nations;
select sum(pop), religion from Religions, nations where nation.code = Religion.code;
select sum(pop), religion from Religions, nations where nation.code = Religion.code group by religion;
select sum(pop * Percent) as Count, Religion from Religions, nations, where nation.code = Religion.code group by religion order by Count desc;
select count(religion) as Count, religion from Religions order by Count desc;
select count(religion) as Count, religion from Religions group by religion order by Count desc;
Which querry produces this?
+-------+------------+
| Count | religion |
+-------+------------+
| 190 | Christian |
| 95 | Muslim |
| 33 | indigenous |
| 23 | Orthodox |
| 22 | Buddhism |
| 20 | Hindu |
| 10 | Jewish |
+-------+------------+
7 rows in set (0.01 sec)