Welcome

Contents:

What’s world.db?

A free open public domain world database ‘n’ schema for use in any (programming) language (e.g. uses plain text fixtures/data sets). Example:

### Countries

ca, Canada,          CAN, 9_984_670 km²,  34_278_406, un|north america
mx, México [Mexico], MEX, 1_972_550 km², 112_322_757, un|north america
us, United States,   USA, 9_629_091 km², 314_167_157, un|north america
...
### Cities

Wien [Vienna], W,  1_731_236, m:1_724_000
Graz,          ST,   265_318
Linz,          O,    191_107
Salzburg,      S,    148_521
Innsbruck,     T,    121_329
...

Web Admin Site

Try the world.db web admin app running on Heroku worlddb.herokuapp.com.

Data Sets

Countries

ca, Canada,          CAN, 9_984_670 km²,  34_278_406, un|north america
mx, México [Mexico], MEX, 1_972_550 km², 112_322_757, un|north america
us, United States,   USA, 9_629_091 km², 314_167_157, un|north america

Source: north-america/countries.txt:

Cities

Wien [Vienna], W,  1_731_236, m:1_724_000
Graz,          ST,   265_318
Linz,          O,    191_107
Salzburg,      S,    148_521
Innsbruck,     T,    121_329

Source: europe/at-austria/cities.txt:

The plain text format reader skips comments (starting with #) and blank lines. Example:

###################################################
# Your comments here
#

Tables, Schema

The world.db includes the following tables:

[add schema pic here]

countries Table

CREATE TABLE "countries" (
  "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  "title" varchar(255) NOT NULL,
  "key" varchar(255) NOT NULL,
  "tag" varchar(255) NOT NULL,
  "synonyms" varchar(255),
  "pop" integer,
  "area" integer,
  "created_at" datetime NOT NULL,
  "updated_at" datetime NOT NULL
);

regions Table

CREATE TABLE "regions" (
  "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  "title" varchar(255) NOT NULL,
  "key" varchar(255) NOT NULL,
  "synonyms" varchar(255),
  "country_id" integer NOT NULL,
  "pop" integer, "area" integer,
  "created_at" datetime NOT NULL,
  "updated_at" datetime NOT NULL
);

cities Table

CREATE TABLE "cities" (
  "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  "title" varchar(255) NOT NULL,
  "key" varchar(255) NOT NULL,
  "synonyms" varchar(255),
  "country_id" integer NOT NULL,
  "region_id" integer,
  "pop" integer,
  "area" integer,
  "created_at" datetime NOT NULL,
  "updated_at" datetime NOT NULL
);

Real World Usage

world.db.admin - A free, open source web admin tool for world.db in Ruby on Rails (version 3.2 and up).

sport.db - free open public domain sports database & schema.

football.db - free open public domain football (soccer) database & schema

formula1.db - free open public domain Formula 1/Formula One database & schema

ski.db - free open public domain ski alpin/alpine ski database & schema

beer.db - free open public domain beer database & schema

Sportbook - free, open source sports betting (prediction) pool in Ruby on Rails (version 3.2 and up).

Alternatives

geonames.org - open geo (geographical) database covers all countries and contains over eight million placenames

worlddb - open world database alpha; includes country, region & city names in many languages names and latitude and longitude numbers and country’s iso 2-letter code.

countries - world countries; includes data from ISO 3166 (countries and states/subdivisions ), ISO 4217 (currency), and E.164 (phone numbers).

countries - world countries with iso codes, currencies and more in JSON, CSV and XML.

django-cities - python script for importing countries, regions, cities etc. from geonames.org

current-countries-of-earth - python script to fetch current ISO 3166 country info; output as JSON

Thank You - Contributors - ¡Gracias! - Obrigado - Danke

Ernesto Chapon - William de Melo Gueiros

License

The world.db schema, data and scripts are dedicated to the public domain. Use it as you please with no restrictions whatsoever.

Questions? Comments?

Send them along to the Open World Database (world.db) and Friends Forum/Mailing List. Thanks!

Edit Me! This website is a public GitHub repo. Please help by forking the project and adding to it.