You could go here:
[http://www.worldatlas.com/aatlas/ctycodes.htm#.Ud6_XW39w24][1]
and get all the country codes. You will have to write some kind of implementation that maps the codes to the names. Now this will work assuming your database uses standard country codes.
Another thing to look at is how did the country codes get in your database in the first place? Obviously there is some function that maps country names to codes. Simply write the inverse of that function.
See having an understanding of math does help one in life.