View ChangeLog
Submit a bug report


Project Home
Submit a patch


wfb2sql is a Perl script that extracts information from the CIA World Factbook and creates SQL statements for IBM DB/2, PostgreSQL or MySQL. This data builds a perfect database for learning and teaching SQL.


07/20/2003: wfb2sql is now being hosted on
05/23/2003: Version 0.3 released. Several bugfixes.


wfb2sql is able to create SQL-statements for the following databases:

  • IBM DB/2
  • MySQL
  • PostgreSQL

The following information can be extracted from the "CIA World Factbook":

  • Country information (name, background, capital, area, coastline)
  • Population information (birth rate, death rate, age structure, labour force, population, population growth)
  • Communication data (number of mainlines in use, cellphones, internet users, internet service providers)
  • Dependent countries
  • Organization memberships
  • Border countries
  • Maps and small or large flag images (as BLOBs)

More features:

  • Outputs schema data and/or INSERT-statements
  • All options can be set via a configuration file or command line switches


wfb2sql (19 kB)
You also need the CIA World Factbook.


Perl 5.004 or higher, Getopt::Long, Pod::Usage, Options::General
Getopt::Long is availiable at
Pod::Usage is availiable at
Options::General is available at


The man page is also available as HTML. Information on the latest changes are available in the ChangeLog.

The CIA World Factbook

The Factbook is available for free at Extract from the Copyright-Statement: "The Factbook is in the public domain. Accordingly, it may be copied freely without permission of the Central Intelligence Agency (CIA).". The complete .zip-archive has as size of approx. 85 MB. Since wfb2sql doesn't need the included PDF-maps, you may also decide to download the smaller version without the PDF-maps. This download is about 15 MB.


wfb2sql has been published under the GNU General Public License.

wfb2sql, Copyright © 2003 University of Tübingen, Arbeitsbereich Datenbanken und Informationssysteme. All rights reserved.