Any developer that works with an international user base will eventually need to determine what country their users are from, what language they speak and read, and sometimes even what currency their users make purchases in. The best way to keep track of that information is to follow the standards set forth by the International Organization for Standardization (ISO), which have become universally accepted since their development in the 1960s and 1970s. The SQL queries compiled here will populate a database with tables containing country, currency, and language data based on ISO standards.
World Countries (ISO 3166)
The countries table contains the following data:
[integer]
number: Numeric code of the country
[string]
alpha2: Two-letter code of the country
[string]
alpha3: Three-letter code of the country
[string]
langEN: English name of the country
[string]
langDE: German name of the country
[string]
langES: Spanish name of the country
[string]
langFR: French name of the country
[string]
tld: Country code top-level domain (ccTLD) of the country
World Currencies (ISO 4217)
The currencies table contains the following data:
[integer]
number: Numeric code of the currency
[string]
alpha3: Three-letter code of the currency
[integer]
decimals: Number of digits after the decimal
[string]
langEN: English name of the currency
[string]
symbol_decimal: Symbol of the currency in decimal numeric character reference codes, separated by semi-colons (;) if the symbol consists of multiple characters. For example, in HTML, turn the number36
into$
to output a dollar symbol ($).
[string]
symbol_hex: Symbol of the currency in hexadecimal numeric character reference codes, separated by semi-colons (;) if the symbol consists of multiple characters. For example, in HTML, turn the string0024
into$
to output a dollar symbol ($). To achieve the same in JavaScript, use\u0024
, and in CSS, use\0024
.
World Languages (ISO 639)
The languages table contains the following data:
[string]
alpha2: Two-letter code of the language
[string]
langEN: English name of the language
[string]
langDE: German name of the language
[string]
langES: Spanish name of the language
[string]
langFR: French name of the language