It isn't necessary to denormalise the states table.
The country_code attribute already exists as the country.iso2 column and can be easily extracted with following SQL query
select * from countries join states on countries.id = states.country_id where countries.iso2 <> "AF";
@ronlinet please fell free to fork and do your modification. regarding the large number of people downloading and using ghe package i would be more conservative on backward compatibility.
It isn't necessary to denormalise the states table. The country_code attribute already exists as the country.iso2 column and can be easily extracted with following SQL query
select * from countries join states on countries.id = states.country_id where countries.iso2 <> "AF";