User Tools

Site Tools


podoc:country_sql_table

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
podoc:country_sql_table [2007/04/12 14:50]
Luud
podoc:country_sql_table [2007/04/20 13:40] (current)
Luud
Line 6: Line 6:
  
 === Description === === Description ===
 +
 +A list of all countries in the world.
  
 === Purpose === === Purpose ===
 +
 +Referential integrity.  
  
 === Schema === === Schema ===
  
-  create table country ( +<code sql> 
-    identifier            integer not null primary key, +create table country ( 
-    code                  varchar(5), +  identifier            integer not null primary key, 
-    value                 varchar(40) +  code                  varchar(5), 
-  );+  value                 varchar(40) 
 +); 
 +</code> 
 + 
 +=== References tables === 
 + 
 +None. 
 + 
 +=== Is referenced by tables === 
 + 
 +  * [[contact_info sql table|contact_info]](country) references identifier 
 +  * [[location sql table|location]](country) references identifier
  
 === Related sequences === === Related sequences ===
Line 22: Line 37:
  
 === Related indexes === === Related indexes ===
 +
 +None.
  
 === Related functions === === Related functions ===
 +
 +None.
  
 === Related views === === Related views ===
 +
 +None.
  
 === History === === History ===
Line 37: Line 58:
 Still in use Still in use
  
-== Change history ==+== Schema change history == 
 + 
 += Version 2.5 = 
 + 
 +<code sql> 
 +create table country ( 
 +  identifier            integer not null primary key, 
 +  code                  varchar(5), 
 +  value                 varchar(40) 
 +); 
 +</code> 
 + 
 +== Data change history ==
  
 = Version 2.5 = = Version 2.5 =
  
-  create table country ( +<code sql> 
-    identifier            integer not null primary key+insert into country values (nextval('country_id_sequence'), 'ad', 'Andorra'); 
-    code                  varchar(5), +insert into country values (nextval('country_id_sequence')'ae', 'United Arab Emirates'); 
-    value                 varchar(40+insert into country values (nextval('country_id_sequence'), 'af', 'Afghanistan'); 
-  );+insert into country values (nextval('country_id_sequence'), 'ag', 'Antigua and Barbuda'); 
 +insert into country values (nextval('country_id_sequence'), 'ai', 'Anguilla'); 
 +insert into country values (nextval('country_id_sequence'), 'al', 'Albania'); 
 +insert into country values (nextval('country_id_sequence'), 'am', 'Armenia'); 
 +insert into country values (nextval('country_id_sequence'), 'an', 'Netherlands Antilles'); 
 +insert into country values (nextval('country_id_sequence'), 'ao', 'Angola'); 
 +insert into country values (nextval('country_id_sequence'), 'aq', 'Antarctica'); 
 +insert into country values (nextval('country_id_sequence'), 'ar', 'Argentina'); 
 +insert into country values (nextval('country_id_sequence'), 'as', 'American Samoa'); 
 +insert into country values (nextval('country_id_sequence'), 'at', 'Austria'); 
 +insert into country values (nextval('country_id_sequence'), 'au', 'Australia'); 
 +insert into country values (nextval('country_id_sequence'), 'aw', 'Aruba'); 
 +insert into country values (nextval('country_id_sequence'), 'az', 'Azerbaijan'); 
 +insert into country values (nextval('country_id_sequence'), 'ba', 'Bosnia and Herzegovina'); 
 +insert into country values (nextval('country_id_sequence'), 'bb', 'Barbados'); 
 +insert into country values (nextval('country_id_sequence'), 'bd', 'Bangladesh'); 
 +insert into country values (nextval('country_id_sequence'), 'be', 'Belgium'); 
 +insert into country values (nextval('country_id_sequence'), 'bf', 'Burkina Faso'); 
 +insert into country values (nextval('country_id_sequence'), 'bg', 'Bulgaria'); 
 +insert into country values (nextval('country_id_sequence'), 'bh', 'Bahrain'); 
 +insert into country values (nextval('country_id_sequence'), 'bi', 'Burundi'); 
 +insert into country values (nextval('country_id_sequence'), 'bj', 'Benin'); 
 +insert into country values (nextval('country_id_sequence'), 'bm', 'Bermuda'); 
 +insert into country values (nextval('country_id_sequence'), 'bn', 'Brunei Darussalam'); 
 +insert into country values (nextval('country_id_sequence'), 'bo', 'Bolivia'); 
 +insert into country values (nextval('country_id_sequence'), 'br', 'Brazil'); 
 +insert into country values (nextval('country_id_sequence'), 'bs', 'Bahamas'); 
 +insert into country values (nextval('country_id_sequence'), 'bt', 'Bhutan'); 
 +insert into country values (nextval('country_id_sequence'), 'bv', 'Bouvet Island'); 
 +insert into country values (nextval('country_id_sequence'), 'bw', 'Botswana'); 
 +insert into country values (nextval('country_id_sequence'), 'by', 'Belarus'); 
 +insert into country values (nextval('country_id_sequence'), 'bz', 'Belize'); 
 +insert into country values (nextval('country_id_sequence'), 'ca', 'Canada'); 
 +insert into country values (nextval('country_id_sequence'), 'cc', 'Cocos (Keeling) Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'cf', 'Central African Republic'); 
 +insert into country values (nextval('country_id_sequence'), 'cg', 'Congo'); 
 +insert into country values (nextval('country_id_sequence'), 'ch', 'Switzerland'); 
 +insert into country values (nextval('country_id_sequence'), 'ck', 'Cook Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'cl', 'Chile'); 
 +insert into country values (nextval('country_id_sequence'), 'cm', 'Cameroon'); 
 +insert into country values (nextval('country_id_sequence'), 'cn', 'China'); 
 +insert into country values (nextval('country_id_sequence'), 'co', 'Colombia'); 
 +insert into country values (nextval('country_id_sequence'), 'cr', 'Costa Rica'); 
 +insert into country values (nextval('country_id_sequence'), 'cu', 'Cuba'); 
 +insert into country values (nextval('country_id_sequence'), 'cv', 'Cape Verde'); 
 +insert into country values (nextval('country_id_sequence'), 'cx', 'Christmas Island'); 
 +insert into country values (nextval('country_id_sequence'), 'cy', 'Cyprus'); 
 +insert into country values (nextval('country_id_sequence'), 'cz', 'Czech Republic'); 
 +insert into country values (nextval('country_id_sequence'), 'de', 'Germany'); 
 +insert into country values (nextval('country_id_sequence'), 'dj', 'Djibouti'); 
 +insert into country values (nextval('country_id_sequence'), 'dk', 'Denmark'); 
 +insert into country values (nextval('country_id_sequence'), 'dm', 'Dominica'); 
 +insert into country values (nextval('country_id_sequence'), 'do', 'Dominican Republic'); 
 +insert into country values (nextval('country_id_sequence'), 'dz', 'Algeria'); 
 +insert into country values (nextval('country_id_sequence'), 'ec', 'Ecuador'); 
 +insert into country values (nextval('country_id_sequence'), 'ee', 'Estonia'); 
 +insert into country values (nextval('country_id_sequence'), 'eg', 'Egypt'); 
 +insert into country values (nextval('country_id_sequence'), 'eh', 'Western Sahara'); 
 +insert into country values (nextval('country_id_sequence'), 'er', 'Eritrea'); 
 +insert into country values (nextval('country_id_sequence'), 'es', 'Spain'); 
 +insert into country values (nextval('country_id_sequence'), 'et', 'Ethiopia'); 
 +insert into country values (nextval('country_id_sequence'), 'fi', 'Finland'); 
 +insert into country values (nextval('country_id_sequence'), 'fj', 'Fiji'); 
 +insert into country values (nextval('country_id_sequence'), 'fk', 'Falkland Islands (Malvinas)'); 
 +insert into country values (nextval('country_id_sequence'), 'fm', 'Micronesia'); 
 +insert into country values (nextval('country_id_sequence'), 'fo', 'Faroe Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'fr', 'France'); 
 +insert into country values (nextval('country_id_sequence'), 'fx', 'France Metropolitan'); 
 +insert into country values (nextval('country_id_sequence'), 'ga', 'Gabon'); 
 +insert into country values (nextval('country_id_sequence'), 'gb', 'Great Britain'); 
 +insert into country values (nextval('country_id_sequence'), 'gd', 'Grenada'); 
 +insert into country values (nextval('country_id_sequence'), 'ge', 'Georgia'); 
 +insert into country values (nextval('country_id_sequence'), 'gf', 'French Guiana'); 
 +insert into country values (nextval('country_id_sequence'), 'gh', 'Ghana'); 
 +insert into country values (nextval('country_id_sequence'), 'gi', 'Gibraltar'); 
 +insert into country values (nextval('country_id_sequence'), 'gl', 'Greenland'); 
 +insert into country values (nextval('country_id_sequence'), 'gm', 'Gambia'); 
 +insert into country values (nextval('country_id_sequence'), 'gn', 'Guinea'); 
 +insert into country values (nextval('country_id_sequence'), 'gp', 'Guadeloupe'); 
 +insert into country values (nextval('country_id_sequence'), 'gq', 'Equatorial Guinea'); 
 +insert into country values (nextval('country_id_sequence'), 'gr', 'Greece'); 
 +insert into country values (nextval('country_id_sequence'), 'gs', 'S. Georgia and S. Sandwich Isls.'); 
 +insert into country values (nextval('country_id_sequence'), 'gt', 'Guatemala'); 
 +insert into country values (nextval('country_id_sequence'), 'gu', 'Guam'); 
 +insert into country values (nextval('country_id_sequence'), 'gw', 'Guinea-Bissau'); 
 +insert into country values (nextval('country_id_sequence'), 'gy', 'Guyana'); 
 +insert into country values (nextval('country_id_sequence'), 'hk', 'Hong Kong'); 
 +insert into country values (nextval('country_id_sequence'), 'hm', 'Heard and McDonald Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'hn', 'Honduras'); 
 +insert into country values (nextval('country_id_sequence'), 'hr', 'Croatia (Hrvatska)'); 
 +insert into country values (nextval('country_id_sequence'), 'ht', 'Haiti'); 
 +insert into country values (nextval('country_id_sequence'), 'hu', 'Hungary'); 
 +insert into country values (nextval('country_id_sequence'), 'id', 'Indonesia'); 
 +insert into country values (nextval('country_id_sequence'), 'ie', 'Ireland'); 
 +insert into country values (nextval('country_id_sequence'), 'il', 'Israel'); 
 +insert into country values (nextval('country_id_sequence'), 'in', 'India'); 
 +insert into country values (nextval('country_id_sequence'), 'io', 'British Indian Ocean Territory'); 
 +insert into country values (nextval('country_id_sequence'), 'iq', 'Iraq'); 
 +insert into country values (nextval('country_id_sequence'), 'ir', 'Iran'); 
 +insert into country values (nextval('country_id_sequence'), 'is', 'Iceland'); 
 +insert into country values (nextval('country_id_sequence'), 'it', 'Italy'); 
 +insert into country values (nextval('country_id_sequence'), 'jm', 'Jamaica'); 
 +insert into country values (nextval('country_id_sequence'), 'jo', 'Jordan'); 
 +insert into country values (nextval('country_id_sequence'), 'jp', 'Japan'); 
 +insert into country values (nextval('country_id_sequence'), 'ke', 'Kenya'); 
 +insert into country values (nextval('country_id_sequence'), 'kg', 'Kyrgyzstan'); 
 +insert into country values (nextval('country_id_sequence'), 'kh', 'Cambodia'); 
 +insert into country values (nextval('country_id_sequence'), 'ki', 'Kiribati'); 
 +insert into country values (nextval('country_id_sequence'), 'km', 'Comoros'); 
 +insert into country values (nextval('country_id_sequence'), 'kn', 'Saint Kitts and Nevis'); 
 +insert into country values (nextval('country_id_sequence'), 'kp', 'Korea (North)'); 
 +insert into country values (nextval('country_id_sequence'), 'kr', 'Korea (South)'); 
 +insert into country values (nextval('country_id_sequence'), 'kw', 'Kuwait'); 
 +insert into country values (nextval('country_id_sequence'), 'ky', 'Cayman Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'kz', 'Kazakhstan'); 
 +insert into country values (nextval('country_id_sequence'), 'la', 'Laos'); 
 +insert into country values (nextval('country_id_sequence'), 'lb', 'Lebanon'); 
 +insert into country values (nextval('country_id_sequence'), 'lc', 'Saint Lucia'); 
 +insert into country values (nextval('country_id_sequence'), 'li', 'Liechtenstein'); 
 +insert into country values (nextval('country_id_sequence'), 'lk', 'Sri Lanka'); 
 +insert into country values (nextval('country_id_sequence'), 'lr', 'Liberia'); 
 +insert into country values (nextval('country_id_sequence'), 'ls', 'Lesotho'); 
 +insert into country values (nextval('country_id_sequence'), 'lt', 'Lithuania'); 
 +insert into country values (nextval('country_id_sequence'), 'lu', 'Luxembourg'); 
 +insert into country values (nextval('country_id_sequence'), 'lv', 'Latvia'); 
 +insert into country values (nextval('country_id_sequence'), 'ly', 'Libya'); 
 +insert into country values (nextval('country_id_sequence'), 'ma', 'Morocco'); 
 +insert into country values (nextval('country_id_sequence'), 'mc', 'Monaco'); 
 +insert into country values (nextval('country_id_sequence'), 'md', 'Moldova'); 
 +insert into country values (nextval('country_id_sequence'), 'mg', 'Madagascar'); 
 +insert into country values (nextval('country_id_sequence'), 'mh', 'Marshall Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'mk', 'Macedonia'); 
 +insert into country values (nextval('country_id_sequence'), 'ml', 'Mali'); 
 +insert into country values (nextval('country_id_sequence'), 'mm', 'Myanmar'); 
 +insert into country values (nextval('country_id_sequence'), 'mn', 'Mongolia'); 
 +insert into country values (nextval('country_id_sequence'), 'mo', 'Macau'); 
 +insert into country values (nextval('country_id_sequence'), 'mp', 'Northern Mariana Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'mq', 'Martinique'); 
 +insert into country values (nextval('country_id_sequence'), 'mr', 'Mauritania'); 
 +insert into country values (nextval('country_id_sequence'), 'ms', 'Montserrat'); 
 +insert into country values (nextval('country_id_sequence'), 'mt', 'Malta'); 
 +insert into country values (nextval('country_id_sequence'), 'mu', 'Mauritius'); 
 +insert into country values (nextval('country_id_sequence'), 'mv', 'Maldives'); 
 +insert into country values (nextval('country_id_sequence'), 'mw', 'Malawi'); 
 +insert into country values (nextval('country_id_sequence'), 'mx', 'Mexico'); 
 +insert into country values (nextval('country_id_sequence'), 'my', 'Malaysia'); 
 +insert into country values (nextval('country_id_sequence'), 'mz', 'Mozambique'); 
 +insert into country values (nextval('country_id_sequence'), 'na', 'Namibia'); 
 +insert into country values (nextval('country_id_sequence'), 'nc', 'New Caledonia'); 
 +insert into country values (nextval('country_id_sequence'), 'ne', 'Niger'); 
 +insert into country values (nextval('country_id_sequence'), 'nf', 'Norfolk Island'); 
 +insert into country values (nextval('country_id_sequence'), 'ng', 'Nigeria'); 
 +insert into country values (nextval('country_id_sequence'), 'ni', 'Nicaragua'); 
 +insert into country values (nextval('country_id_sequence'), 'nl', 'Netherlands'); 
 +insert into country values (nextval('country_id_sequence'), 'no', 'Norway'); 
 +insert into country values (nextval('country_id_sequence'), 'np', 'Nepal'); 
 +insert into country values (nextval('country_id_sequence'), 'nr', 'Nauru'); 
 +insert into country values (nextval('country_id_sequence'), 'nt', 'Neutral Zone'); 
 +insert into country values (nextval('country_id_sequence'), 'nu', 'Niue'); 
 +insert into country values (nextval('country_id_sequence'), 'nz', 'New Zealand (Aotearoa)'); 
 +insert into country values (nextval('country_id_sequence'), 'om', 'Oman'); 
 +insert into country values (nextval('country_id_sequence'), 'pa', 'Panama'); 
 +insert into country values (nextval('country_id_sequence'), 'pe', 'Peru'); 
 +insert into country values (nextval('country_id_sequence'), 'pf', 'French Polynesia'); 
 +insert into country values (nextval('country_id_sequence'), 'pg', 'Papua New Guinea'); 
 +insert into country values (nextval('country_id_sequence'), 'ph', 'Philippines'); 
 +insert into country values (nextval('country_id_sequence'), 'pk', 'Pakistan'); 
 +insert into country values (nextval('country_id_sequence'), 'pl', 'Poland'); 
 +insert into country values (nextval('country_id_sequence'), 'pm', 'St. Pierre and Miquelon'); 
 +insert into country values (nextval('country_id_sequence'), 'pn', 'Pitcairn'); 
 +insert into country values (nextval('country_id_sequence'), 'pr', 'Puerto Rico'); 
 +insert into country values (nextval('country_id_sequence'), 'pt', 'Portugal'); 
 +insert into country values (nextval('country_id_sequence'), 'pw', 'Palau'); 
 +insert into country values (nextval('country_id_sequence'), 'py', 'Paraguay'); 
 +insert into country values (nextval('country_id_sequence'), 'qa', 'Qatar'); 
 +insert into country values (nextval('country_id_sequence'), 're', 'Reunion'); 
 +insert into country values (nextval('country_id_sequence'), 'ro', 'Romania'); 
 +insert into country values (nextval('country_id_sequence'), 'ru', 'Russian Federation'); 
 +insert into country values (nextval('country_id_sequence'), 'rw', 'Rwanda'); 
 +insert into country values (nextval('country_id_sequence'), 'sa', 'Saudi Arabia'); 
 +insert into country values (nextval('country_id_sequence'), 'sb', 'Solomon Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'sc', 'Seychelles'); 
 +insert into country values (nextval('country_id_sequence'), 'sd', 'Sudan'); 
 +insert into country values (nextval('country_id_sequence'), 'se', 'Sweden'); 
 +insert into country values (nextval('country_id_sequence'), 'sg', 'Singapore'); 
 +insert into country values (nextval('country_id_sequence'), 'sh', 'St. Helena'); 
 +insert into country values (nextval('country_id_sequence'), 'si', 'Slovenia'); 
 +insert into country values (nextval('country_id_sequence'), 'sj', 'Svalbard and Jan Mayen Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'sk', 'Slovak Republic'); 
 +insert into country values (nextval('country_id_sequence'), 'sl', 'Sierra Leone'); 
 +insert into country values (nextval('country_id_sequence'), 'sm', 'San Marino'); 
 +insert into country values (nextval('country_id_sequence'), 'sn', 'Senegal'); 
 +insert into country values (nextval('country_id_sequence'), 'so', 'Somalia'); 
 +insert into country values (nextval('country_id_sequence'), 'sr', 'Suriname'); 
 +insert into country values (nextval('country_id_sequence'), 'st', 'Sao Tome and Principe'); 
 +insert into country values (nextval('country_id_sequence'), 'sv', 'El Salvador'); 
 +insert into country values (nextval('country_id_sequence'), 'sy', 'Syria'); 
 +insert into country values (nextval('country_id_sequence'), 'sz', 'Swaziland'); 
 +insert into country values (nextval('country_id_sequence'), 'tc', 'Turks and Caicos Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'td', 'Chad'); 
 +insert into country values (nextval('country_id_sequence'), 'tf', 'French Southern Territories'); 
 +insert into country values (nextval('country_id_sequence'), 'tg', 'Togo'); 
 +insert into country values (nextval('country_id_sequence'), 'th', 'Thailand'); 
 +insert into country values (nextval('country_id_sequence'), 'tj', 'Tajikistan'); 
 +insert into country values (nextval('country_id_sequence'), 'tk', 'Tokelau'); 
 +insert into country values (nextval('country_id_sequence'), 'tm', 'Turkmenistan'); 
 +insert into country values (nextval('country_id_sequence'), 'tn', 'Tunisia'); 
 +insert into country values (nextval('country_id_sequence'), 'to', 'Tonga'); 
 +insert into country values (nextval('country_id_sequence'), 'tp', 'East Timor'); 
 +insert into country values (nextval('country_id_sequence'), 'tr', 'Turkey'); 
 +insert into country values (nextval('country_id_sequence'), 'tt', 'Trinidad and Tobago'); 
 +insert into country values (nextval('country_id_sequence'), 'tv', 'Tuvalu'); 
 +insert into country values (nextval('country_id_sequence'), 'tw', 'Taiwan'); 
 +insert into country values (nextval('country_id_sequence'), 'tz', 'Tanzania'); 
 +insert into country values (nextval('country_id_sequence'), 'ua', 'Ukraine'); 
 +insert into country values (nextval('country_id_sequence'), 'ug', 'Uganda'); 
 +insert into country values (nextval('country_id_sequence'), 'uk', 'United Kingdom'); 
 +insert into country values (nextval('country_id_sequence'), 'um', 'US Minor Outlying Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'us', 'United States'); 
 +insert into country values (nextval('country_id_sequence'), 'uy', 'Uruguay'); 
 +insert into country values (nextval('country_id_sequence'), 'uz', 'Uzbekistan'); 
 +insert into country values (nextval('country_id_sequence'), 'va', 'Vatican City State (Holy See)'); 
 +insert into country values (nextval('country_id_sequence'), 'vc', 'Saint Vincent and the Grenadines'); 
 +insert into country values (nextval('country_id_sequence'), 've', 'Venezuela'); 
 +insert into country values (nextval('country_id_sequence'), 'vg', 'Virgin Islands (British)'); 
 +insert into country values (nextval('country_id_sequence'), 'vi', 'Virgin Islands (U.S.)'); 
 +insert into country values (nextval('country_id_sequence'), 'vn', 'Viet Nam'); 
 +insert into country values (nextval('country_id_sequence'), 'vu', 'Vanuatu'); 
 +insert into country values (nextval('country_id_sequence'), 'wf', 'Wallis and Futuna Islands'); 
 +insert into country values (nextval('country_id_sequence'), 'ws', 'Samoa'); 
 +insert into country values (nextval('country_id_sequence'), 'ye', 'Yemen'); 
 +insert into country values (nextval('country_id_sequence'), 'yt', 'Mayotte'); 
 +insert into country values (nextval('country_id_sequence'), 'yu', 'Yugoslavia'); 
 +insert into country values (nextval('country_id_sequence'), 'za', 'South Africa'); 
 +insert into country values (nextval('country_id_sequence'), 'zm', 'Zambia'); 
 +insert into country values (nextval('country_id_sequence'), 'zr', 'Zaire'); 
 +insert into country values (nextval('country_id_sequence'), 'zw', 'Zimbabwe'); 
 +</code>
  
podoc/country_sql_table.1176389433.txt.gz · Last modified: 2007/04/12 14:50 by Luud