normalisePays.sql 2.09 KB
-- PREPARATION TABLE editeur
-- Standardisation des valeurs de PAYS dans editeur
update editeur set PAYS='Allemagne' where PAYS in ('Deutschland');
update editeur set PAYS='Australie' where PAYS in ('Australia');
update editeur set PAYS='Espagne' where PAYS in ('España');
update editeur set PAYS='Pologne' where PAYS in ('Polska');
update editeur set PAYS='Royaume-Uni' where PAYS in ('United Kingdom', 'Royaume Uni', 'Grande-Bretagne', 'United Kingdoms', 'Royaumes Unis', 'Angleterre', 'UK');
update editeur set PAYS='États-Unis' where PAYS in ('USA', 'Etats Unis', 'Etats-Unis d\'Amérique', 'Etats Unis d\'Amérique', 'Caroline du Sud');
update editeur set PAYS='République thèque' where PAYS in ('Ceska Republika');
update editeur set PAYS='Finlande' where PAYS in ('Suomi / Finlande');
update editeur set PAYS='Suède' where PAYS in ('Sverige / Suède');
update editeur set PAYS='Italie' where PAYS in ('Italia');
update editeur set PAYS='Grèce' where PAYS in ('Ellada  / Grèce', 'Ellada / Grèce');
update editeur set PAYS='Brésil' where PAYS in ('Brasil/Brésil', 'Brasil', 'Brasilia');
update editeur set PAYS='Nouvelle-Zélande' where PAYS in ('New Zealand', 'New-Zeland');
-- Suppression d'un pays imaginaire
--	http://www.legrog.org/editeurs/hugin-munin
update editeur set PAYS=NULL where PAYS='France / Canada';

-- PREPARATION TABLE pays
-- Ajouts dans la table pays pour intégration
insert into pays (LIB_PAYS) values ('République thèque');
insert into pays (LIB_PAYS) values ('Finlande');
insert into pays (LIB_PAYS) values ('Suède');
insert into pays (LIB_PAYS) values ('Italie');
insert into pays (LIB_PAYS) values ('Grèce');
insert into pays (LIB_PAYS) values ('Brésil');
insert into pays (LIB_PAYS) values ('Nouvelle-Zélande');
insert into pays (LIB_PAYS) values ('Japon');
insert into pays (LIB_PAYS) values ('Corée du Sud');
insert into pays (LIB_PAYS) values ('Pays-Bas');
insert into pays (LIB_PAYS) values ('Hongrie');
update pays set LIB_PAYS='États-Unis' where LIB_PAYS='USA';

-- CONTROLE MATCHING
select ID_EDITEUR from editeur
where PAYS is not null
and PAYS not in (select LIB_PAYS from pays);