ALTER TABLE `attendance` 
ADD COLUMN `serial_lop` INT(11) NULL DEFAULT NULL AFTER `serial_scd`,
ADD COLUMN `serial_sbc` INT(11) NULL DEFAULT NULL AFTER `serial_lop`,
ADD COLUMN `serial_sps` INT(11) NULL DEFAULT NULL AFTER `serial_sbc`,
ADD INDEX `fk_relationship_28601` (`serial_lop` ASC),
ADD INDEX `fk_relationship_28402` (`serial_sbc` ASC);
ALTER TABLE `attendance` 
ADD CONSTRAINT `fk_relationship_28601`
  FOREIGN KEY (`serial_lop`)
  REFERENCES `level_optional_group` (`serial_lop`)
  ON DELETE RESTRICT
  ON UPDATE RESTRICT,
ADD CONSTRAINT `fk_relationship_28402`
  FOREIGN KEY (`serial_sbc`)
  REFERENCES `subject_course` (`serial_sbc`)
  ON DELETE RESTRICT
  ON UPDATE RESTRICT;