ALTER TABLE IF EXISTS public.nazioni
ADD COLUMN IF NOT EXISTS iso TEXT;


UPDATE public.nazioni
SET
    nome = v.new_nome
FROM (
        VALUES ('Z204', 'BAHRAIN'), ('Z153', 'BOSNIA ED ERZEGOVINA'), ('Z140', 'MOLDAVIA'), ('Z518', 'PORTO RICO')
    ) AS v (codice_belfiore, new_nome)
WHERE
    nazioni.catasto = v.codice_belfiore;

UPDATE public.nazioni
SET
    iso = DATA.iso
FROM (
        VALUES ('Z200', 'AF'), ('Z100', 'AL'), ('Z301', 'DZ'), ('Z101', 'AD'), ('Z302', 'AO'), ('Z529', 'AI'), ('Z532', 'AG'), ('Z501', 'AN'), ('Z203', 'SA'), ('Z600', 'AR'), ('Z252', 'AM'), ('Z700', 'AU'), ('Z102', 'AT'), ('Z253', 'AZ'), ('Z502', 'BS'), ('Z204', 'BH'), ('Z249', 'BD'), ('Z522', 'BB'), ('Z103', 'BE'), ('Z512', 'BZ'), ('Z314', 'BJ'), ('Z400', 'BM'), ('Z205', 'BT'), ('Z139', 'BY'), ('Z601', 'BO'), ('Z153', 'BA'), ('Z358', 'BW'), ('Z602', 'BR'), ('Z207', 'BN'), ('Z104', 'BG'), ('Z354', 'BF'), ('Z305', 'BI'), ('Z208', 'KH'), ('Z306', 'CM'), ('Z401', 'CA'), ('Z307', 'CV'), ('Z309', 'TD'), ('Z603', 'CL'), ('Z210', 'CN'), ('Z211', 'CY'), ('Z604', 'CO'), ('Z310', 'KM'), ('Z503', 'CR'), ('Z313', 'CI'), ('Z149', 'HR'), ('Z504', 'CU'), ('Z107', 'DK'), ('Z526', 'DM'), ('Z605', 'EC'), ('Z336', 'EG'), ('Z506', 'SV'), ('Z215', 'AE'), ('Z368', 'ER'), ('Z144', 'EE'), ('Z315', 'ET'), ('Z216', 'PH'), ('Z109', 'FI'), ('Z110', 'FR'), ('Z316', 'GA'), ('Z317', 'GM'), ('Z254', 'GE'), ('Z112', 'DE'), ('Z318', 'GH'), ('Z507', 'JM'), ('Z219', 'JP'), ('Z113', 'GI'), ('Z361', 'DJ'), ('Z220', 'JO'), ('Z115', 'GR'), ('Z524', 'GD'), ('Z402', 'GL'), ('Z508', 'GP'), ('Z509', 'GT'), ('Z319', 'GN'), ('Z321', 'GQ'), ('Z606', 'GY'), ('Z607', 'GF'), ('Z510', 'HT'), ('Z511', 'HN'), ('Z222', 'IN'), ('Z223', 'ID'), ('Z224', 'IR'), ('Z225', 'IQ'), ('Z116', 'IE'), ('Z117', 'IS'), ('Z122', 'IM'), ('Z530', 'KY'), ('Z703', 'CK'), ('Z711', 'MH'), ('Z722', 'PN'), ('Z724', 'SB'), ('Z525', 'VG'), ('Z226', 'IL'), ('Z255', 'KZ'), ('Z322', 'KE'), ('Z256', 'KG'), ('Z731', 'KI'), ('Z160', 'XK'), ('Z227', 'KW'), ('Z228', 'LA'), ('Z359', 'LS'), ('Z145', 'LV'), ('Z229', 'LB'), ('Z325', 'LR'), ('Z326', 'LY'), ('Z119', 'LI'), ('Z146', 'LT'), ('Z120', 'LU'), ('Z231', 'MO'), ('Z148', 'MK'), ('Z327', 'MG'), ('Z328', 'MW'), ('Z247', 'MY'), ('Z232', 'MV'), ('Z329', 'ML'), ('Z121', 'MT'), ('Z330', 'MA'), ('Z513', 'MQ'), ('Z331', 'MR'), ('Z332', 'MU'), ('Z360', 'YT'), ('Z514', 'MX'), ('Z140', 'MD'), ('Z123', 'MC'), ('Z233', 'MN'), ('Z159', 'ME'), ('Z531', 'MS'), ('Z333', 'MZ'), ('Z206', 'MM'), ('Z300', 'NA'), ('Z713', 'NR'), ('Z234', 'NP'), ('Z515', 'NI'), ('Z334', 'NE'), ('Z335', 'NG'), ('Z714', 'NU'), ('Z125', 'NO'), ('Z716', 'NC'), ('Z719', 'NZ'), ('Z235', 'OM'), ('Z126', 'NL'), ('Z236', 'PK'), ('Z734', 'PW'), ('Z516', 'PA'), ('Z730', 'PG'), ('Z610', 'PY'), ('Z611', 'PE'), ('Z127', 'PL'), ('Z518', 'PR'), ('Z128', 'PT'), ('Z237', 'QA'), ('Z114', 'GB'), ('Z156', 'CZ'), ('Z308', 'CF'), ('Z312', 'CD'), ('Z505', 'DO'), ('Z324', 'RE'), ('Z129', 'RO'), ('Z338', 'RW'), ('Z154', 'RU'), ('Z533', 'KN'), ('Z403', 'PM'), ('Z528', 'VC'), ('Z726', 'WS'), ('Z130', 'SM'), ('Z340', 'SH'), ('Z343', 'SN'), ('Z158', 'RS'), ('Z342', 'SC'), ('Z344', 'SL'), ('Z248', 'SG'), ('Z240', 'SY'), ('Z155', 'SK'), ('Z150', 'SI'), ('Z345', 'SO'), ('Z131', 'ES'), ('Z209', 'LK'), ('Z404', 'US'), ('Z907', 'SS'), ('Z348', 'SD'), ('Z608', 'SR'), ('Z132', 'SE'), ('Z133', 'CH'), ('Z257', 'TJ'), ('Z217', 'TW'), ('Z357', 'TZ'), ('Z241', 'TH'), ('Z351', 'TG'), ('Z728', 'TO'), ('Z612', 'TT'), ('Z352', 'TN'), ('Z243', 'TR'), ('Z258', 'TM'), ('Z732', 'TV'), ('Z138', 'UA'), ('Z353', 'UG'), ('Z134', 'HU'), ('Z613', 'UY'), ('Z259', 'UZ'), ('Z733', 'VU'), ('Z614', 'VE'), ('Z251', 'VN'), ('Z246', 'YE'), ('Z355', 'ZM'), ('Z337', 'ZW')
    ) AS DATA (catasto, iso)
WHERE
    nazioni.catasto = DATA.catasto;