2

Am working on international project, and want design 3 major tables structure as required in my project:

  1. Country Table (contains all country_name, iso_code, calling_codes)
  2. Currency Table (contains all currency_name, currency_code )
  3. TimeZone Table (Contains all GMT_coordinates and its GMT_fullname Like: -10.0 (GMT-10:00)-Hawaii )

Am confused with tables data-types structure. I searched & google it, but many confused answers and different structure.

So, Please Suggest a proper table structure with appropriate fields data-types, i will appreciates all your suggestion and answers.

Advance thanks to all my mates!

3

1 Answer 1

6

There are some surprises when working with currencies and time zones for every country in the world. I would look up on Geonames and their data, to get an idea of what to expect.

From experience with the Geonames data, you will need the following fields:

Country info

  • country name - VARCHAR(50)
  • ISO code - CHAR(2)
  • calling code - INTEGER(4)

Currency

  • code - CHAR(3)
  • name - VARCHAR(10)

With the data in the Geonames database, these data fields and their respective sizes should cover every country in the world. I haven't made the actual model or its links as you haven't specified which language you are working with. I'm not sure what the appropriate length for the time zone string should be, I guess you need to look that up.

If you also need to populate the tables with all countries, Geonames is just the thing.

Country name, ISO codes, calling code and currencies: http://download.geonames.org/export/dump/countryInfo.txt

Time zones are a bit more tricky, as many countries have several time zones. The data is there, but you have to iterate the data set to find the different time zones per country.

Geonames' data dumps: http://download.geonames.org/export/dump/

Here is a forum thread about importing the Geonames data to a MySQL database: http://forum.geonames.org/gforum/posts/list/15/732.page

1
  • 1
    For time zones, I have found the data at timezonedb.com to be far more useful than GeoNames'. May 14, 2015 at 1:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.