MySQL Basics: Select Exercises: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 8: Line 8:

Download the [[MySQL]] handouts! (8 pages) [[[MySQL]].pdf]
Download the [[MySQL]] handouts! (8 pages) []

Latest revision as of 00:44, 23 May 2008

The US Government organizes and publishes online a publically accessible database of various information and statistics organized by country. Each year, a new version of the "CIA Worldfactbook" is made available. Via the website ( it's possible to download the lot as a big zip of HTML files. Handy for planning your next coup when out of range of an Internet connection, but much more interesting would be to do retrieval / summarizing with SQL...

Happily, using the open source wfb2sql script,, it's possible to convert / scrape these HTML files into SQL suitable for "sourcing" into your very own MySQL database.

A sample resulting database (based on 2004 data):

  • attachment:factbook2004.sql.gz

Download the MySQL handouts! (8 pages) [1]


  • attachment:SQLSelectExercises1.pdf
  • attachment:SQLSelectExercises2.pdf