CREATE TABLE IF NOT EXISTS `optional_subject_course` (
  `serial_osc` INT NOT NULL  AUTO_INCREMENT, 
  `serial_osb` INT(11) NOT NULL,
  `serial_crs` INT(11) NOT NULL,
  `status_osc` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT 'ACTIVE',
  `options_osc` SET('CHECK_IN_SELECT_STUDENTS') NULL DEFAULT 'CHECK_IN_SELECT_STUDENTS',
  PRIMARY KEY (`serial_osc`),
  INDEX `fk_optional_subject_has_course_course1_idx` (`serial_crs` ASC),
  INDEX `fk_optional_subject_has_course_optional_subject1_idx` (`serial_osb` ASC),
  CONSTRAINT `fk_optional_subject_has_course_optional_subject1`
    FOREIGN KEY (`serial_osb`)
    REFERENCES `optional_subject` (`serial_osb`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_optional_subject_has_course_course1`
    FOREIGN KEY (`serial_crs`)
    REFERENCES `course` (`serial_crs`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
