CREATE TABLE `year_payment_concept_without_debts` (
  `serial_ypcwd` INT NOT NULL AUTO_INCREMENT,
  `serial_pct` INT NOT NULL,
  `serial_scy` INT NOT NULL,
  `serial_set` INT NOT NULL,
  `serial_spt` INT NOT NULL,
  `serial_lvl` INT NOT NULL,
  `status_ypcwd` ENUM('ACTIVE', 'INACTIVE') NOT NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_ypcwd`),
  INDEX `foreign_payment_concept_idx` (`serial_pct` ASC),
  INDEX `foreign_school_year_idx` (`serial_scy` ASC),
  INDEX `foreign_specialty_idx` (`serial_spt` ASC),
  INDEX `foreign_section_idx` (`serial_set` ASC),
  INDEX `foreign_level_idx` (`serial_lvl` ASC),
  CONSTRAINT `foreign_payment_concept`
    FOREIGN KEY (`serial_pct`)
    REFERENCES `payment_concept` (`serial_pct`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `foreign_school_year`
    FOREIGN KEY (`serial_scy`)
    REFERENCES `school_year` (`serial_scy`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `foreign_specialty`
    FOREIGN KEY (`serial_spt`)
    REFERENCES `specialty` (`serial_spt`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `foreign_section`
    FOREIGN KEY (`serial_set`)
    REFERENCES `section` (`serial_set`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `foreign_level`
    FOREIGN KEY (`serial_lvl`)
    REFERENCES `level` (`serial_lvl`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

CREATE TABLE `student_year_payment_concept_without_debts` (
  `serial_pwd` INT NOT NULL AUTO_INCREMENT,
  `serial_std` INT NOT NULL,
  `serials_ypcwd` VARCHAR(100) NOT NULL,
  `status_pwd` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_pwd`),
  INDEX `foreign_student_idx` (`serial_std` ASC),
  CONSTRAINT `foreign_student`
    FOREIGN KEY (`serial_std`)
    REFERENCES `student` (`serial_std`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);
