Table nations
 
Field Name Field Meaning Example
Code A two letter unique key us
Name A human readable name United States
Area Area in square miles 3701422
Pop Population 272639616
Pop_Growth Growth of population per year 0.01
GDP Gross Domestic Product 8511.00
GDP_Growth Growth in GDP per year 0.04
Exports Exports in Billions 663.0
Imports Imports in Billions 912.0
Gov_Revenue Central gov revenue in billions US$ 1722.0
Gov_Exp Central gov spending in billion US$ 1653.00
Inflation Rate of inflation 0.02
Debt Central gov debt in billion US$ 862.00??
Military Military spending in billion US$ 267.20
Latitude A spot near the center of the nation 38.00
Longitude A spot near the center of the nation -97.00
Literacy Rate of literacy among adults (blank) 0.00
Arable_Pct Percent of land that is arable (blank) 0.00
Map What map would you find this nation on? North America

Table Religions
 
Field Name Field Meaning Example
Code A two letter key, matches table nations us
Religion The religion for this record Christian
Percent The percent of people from that nation of that religion 84.00

Table borders
 
Field Name Field Meaning Example
Code1 One of the nations sharing the border us
Code2 The other nation sharing the border ca
Length How long is the border in miles 5513.66

Table Polygons  

Field Name
Field Meaning
Example
Code
The code of the nation containing this polygon
'mx'
Polygon
Which polygon is being described
3

Table Edges

Field Name Field Meaning


Example
Polygon
To which polygon does this point belong
2
Edge
To which edge does this point belong
3
Latitude
The latitude of the point (negative is south)
12.87
Longitude
The longitude of the point (negative is west)
17.98


How the Map Stuff Works

Set the color for the nation in question.
Go through the Polygon table, finding every polygon for the nation in question.
For each polygon,

Examples
select name, area from nations where code = "fr";
select count(Code2) from borders where Code1 = "us";
select sum(Length) from borders where Code1 = "us";
select name, area, Religions, Percent from nations, Religions where Religions.code = nations.code;
select nation.Pop, nations.Code, Religions.Religion, nation.Pop*Religions.Percent/100 from Religions, nations where nations.code = "us" and Religions.code = nations.code;
select Code1, Code2, Length from borders where Code1 = "ch" order by Length desc; (asc would be the other order)

Questions:

Which is bigger, Canada or Mexico?

What is the most populus nation?

Which spends more on the military, Russia or China?

Which has more people, Canada or the United Kingdom?

What nations have a government surplus (spending less than revenue)?

What is the longest border in the world?

Which nations have more people that the U.S.?

How many nations border Russia, and what are their names (not codes).

Which is more crowded (people per sq mile) America or Mexico?

If A has a border in the border table with B, does B also have a border with A?  For example, if (us, ca, 5513.66) is in the table, is (ca, us, 5513.66)?

How many Americans are Jewish?