I have or am going to have a database with countries and their emissions. Countries in the API have a 3-letter ISO Code. Should I use this for identifying the countries in database, or just a plain numeric id?
CREATE TABLE country
(
countryid integer PRIMARY KEY NOT NULL,
),
CREATE TABLE country_emissions
(
id integer PRIMARY KEY NOT NULL,
countryid id NOT NULL references country(countryid),
year smallint NOT NULL,
emissions integer
),
So, could countryid in this case be replaced with countries' respectable ISO code?
Reason why I'm not sure is cause numbers seem more logical as you can't really typo them, where as you can have the ISO code written with lower case letters, etc. But then again, you wouldn't have to fetch the numeric ID of a country before adding emissions, you could just straight add them with the country ISO code.