select concat('UPDATE CAMPUS set KEY_SPACE_CAMPUS = ', SPACE.ID_INTERNAL , ' where NAME = "Alameda"', ';') as "" from SPACE INNER JOIN SPACE_INFORMATION ON SPACE.ID_INTERNAL = SPACE_INFORMATION.KEY_SPACE WHERE SPACE_INFORMATION.NAME = "Alameda";
select concat('UPDATE CAMPUS set KEY_SPACE_CAMPUS = ', SPACE.ID_INTERNAL , ' where NAME = "TagusPark"', ';') as "" from SPACE INNER JOIN SPACE_INFORMATION ON SPACE.ID_INTERNAL = SPACE_INFORMATION.KEY_SPACE WHERE SPACE_INFORMATION.NAME = "Tagus-Park";

select concat('UPDATE SPACE set KEY_OLD_CAMPUS = ', CAMPUS.ID_INTERNAL , ' where ID_INTERNAL = ', SPACE.ID_INTERNAL , ';') as "" from CAMPUS inner join SPACE on CAMPUS.KEY_SPACE_CAMPUS = SPACE.ID_INTERNAL WHERE CAMPUS.NAME = "Alameda";
select concat('UPDATE SPACE set KEY_OLD_CAMPUS = ', CAMPUS.ID_INTERNAL , ' where ID_INTERNAL = ', SPACE.ID_INTERNAL , ';') as "" from CAMPUS inner join SPACE on CAMPUS.KEY_SPACE_CAMPUS = SPACE.ID_INTERNAL WHERE CAMPUS.NAME = "TagusPark";
