BEGIN; ALTER TABLE person ADD COLUMN educationnumeric int; UPDATE person SET educationnumeric =0 WHERE educationlevel = 'Preschool'; UPDATE person SET educationnumeric =1 WHERE educationlevel = '1st-4th'; UPDATE person SET educationnumeric =2 WHERE educationlevel = '5th-6th'; UPDATE person SET educationnumeric =3 WHERE educationlevel = '7th-8th'; UPDATE person SET educationnumeric =4 WHERE educationlevel = '9th'; UPDATE person SET educationnumeric =5 WHERE educationlevel = '10th'; UPDATE person SET educationnumeric =6 WHERE educationlevel = '11th'; UPDATE person SET educationnumeric =7 WHERE educationlevel = '12th'; UPDATE person SET educationnumeric =8 WHERE educationlevel = 'HS-grad'; UPDATE person SET educationnumeric =10 WHERE educationlevel = 'Assoc-voc'; UPDATE person SET educationnumeric =12 WHERE educationlevel = 'Some-college'; UPDATE person SET educationnumeric =14 WHERE educationlevel = 'Prof-school'; UPDATE person SET educationnumeric =15 WHERE educationlevel = 'Assoc-acdm'; UPDATE person SET educationnumeric =17 WHERE educationlevel = 'Bachelors'; UPDATE person SET educationnumeric =19 WHERE educationlevel = 'Masters'; UPDATE person SET educationnumeric =22 WHERE educationlevel = 'Doctorate'; /* 0 Preschool, 1 1st-4th, 2 5th-6th, 3 7th-8th, 4 9th, 5 10th, 6 11th, 7 12th, 8 HS-grad, 10 Assoc-voc, 12 Some-college, 14 Prof-school, 15 Assoc-acdm, 17 Bachelors, 19 Masters, 22 Doctorate, */ END;