alter table TEACHER add column KEY_WEEKLY_OCCUPATION int(11);

select concat('update TEACHER set TEACHER.KEY_WEEKLY_OCCUPATION = ',
		WEEKLY_OCUPATION.ID_INTERNAL,
		' where TEACHER.ID_INTERNAL = ',
		TEACHER.ID_INTERNAL, ';') as "" from TEACHER inner join WEEKLY_OCUPATION on WEEKLY_OCUPATION.KEY_TEACHER = TEACHER.ID_INTERNAL;