SELECT CONCAT('UPDATE ENROLMENT_EVALUATION SET ENROLMENT_EVALUATION.STATE = 1 WHERE ENROLMENT_EVALUATION.ID_INTERNAL = ', ENROLMENT_EVALUATION.ID_INTERNAL,';') AS "" FROM ENROLMENT INNER JOIN ENROLMENT_EVALUATION ON ENROLMENT.ID_INTERNAL = ENROLMENT_EVALUATION.KEY_ENROLMENT WHERE (ENROLMENT.KEY_EXECUTION_PERIOD = 2 OR ENROLMENT.KEY_EXECUTION_PERIOD = 80) AND ENROLMENT_EVALUATION.EVALUATION_TYPE <> "IMPROVEMENT" AND ENROLMENT_EVALUATION.STATE = 2 AND ENROLMENT.STATE <> "ENROLLED";