select concat('update FINAL_DEGREE_WORK_PROPOSAL set KEY_SCHEDULEING = ', FINAL_DEGREE_WORK_SCHEDULEING.ID_INTERNAL, ' where ID_INTERNAL = ', FINAL_DEGREE_WORK_PROPOSAL.ID_INTERNAL, ';') as "" from FINAL_DEGREE_WORK_PROPOSAL inner join EXECUTION_DEGREE on EXECUTION_DEGREE.ID_INTERNAL = FINAL_DEGREE_WORK_PROPOSAL.KEY_EXECUTION_DEGREE inner join FINAL_DEGREE_WORK_SCHEDULEING on FINAL_DEGREE_WORK_SCHEDULEING.ID_INTERNAL = EXECUTION_DEGREE.KEY_FINAL_DEGREE_WORK_SCHEDULEING ;