start to translate Oracle SQL script into MYSQL