DROP TABLE IF EXISTS `subject_group_qualitative_equivalence` ;
DROP TABLE IF EXISTS `subject_group_qualitative_equivalence` ;
DROP TABLE IF EXISTS `group_qualitative_equivalence` ;
-- -----------------------------------------------------
-- Table `group_qualitative_equivalence`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `group_qualitative_equivalence` ;

CREATE TABLE IF NOT EXISTS `group_qualitative_equivalence` (
  `serial_gqe` INT(11) NOT NULL AUTO_INCREMENT,
  `name_gqe` VARCHAR(45) NULL DEFAULT NULL,
  `status_gqe` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT NULL,
  PRIMARY KEY (`serial_gqe`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `subject_qualitative_equivalence`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `subject_qualitative_equivalence` ;

CREATE TABLE IF NOT EXISTS `subject_qualitative_equivalence` (
  `serial_sqe` INT(11) NOT NULL AUTO_INCREMENT,
  `serial_gqe` INT(11) NULL,
  `lower_percentage_sqe` VARCHAR(45) NULL DEFAULT NULL,
  `higher_percentage_sqe` VARCHAR(45) NULL DEFAULT NULL,
  `name_sqe` VARCHAR(45) NULL DEFAULT NULL,
  `code_sqe` VARCHAR(45) NULL DEFAULT NULL,
  `description_sqe` VARCHAR(500) NULL DEFAULT NULL,
  `status_sqe` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT NULL,
  PRIMARY KEY (`serial_sqe`),
  CONSTRAINT `fk_subject_qualitative_equivalence_group_qualitative_equivale1`
    FOREIGN KEY (`serial_gqe`)
    REFERENCES `group_qualitative_equivalence` (`serial_gqe`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
;

-- -----------------------------------------------------
-- Table `subject_group_qualitative_equivalence`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `subject_group_qualitative_equivalence` ;

CREATE TABLE IF NOT EXISTS `subject_group_qualitative_equivalence` (
  `serial_sgq` INT(11) NOT NULL AUTO_INCREMENT,
  `serial_sbc` INT(11) NULL DEFAULT NULL,
  `serial_osb` INT(11) NULL DEFAULT NULL,
  `serial_gqe` INT(11) NULL,
  `status_sgq` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT NULL,
  PRIMARY KEY (`serial_sgq`),
  CONSTRAINT `fk_subject_course_has_group_qualitative_equivalence_optional_1`
    FOREIGN KEY (`serial_osb`)
    REFERENCES `optional_subject` (`serial_osb`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_subject_course_has_group_qualitative_equivalence_subject_c1`
    FOREIGN KEY (`serial_sbc`)
    REFERENCES `subject_course` (`serial_sbc`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_subject_group_qualitative_equivalence_group_qualitative_eq1`
    FOREIGN KEY (`serial_gqe`)
    REFERENCES `group_qualitative_equivalence` (`serial_gqe`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

INSERT INTO `group_qualitative_equivalence` (`serial_gqe`, `name_gqe`, `status_gqe`) VALUES ('1', 'Desarrollo humano integral', 'ACTIVE');
INSERT INTO `group_qualitative_equivalence` (`serial_gqe`, `name_gqe`, `status_gqe`) VALUES ('2', 'Proyectos escolares', 'ACTIVE');

INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('1', '20', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('2', '28', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('3', '37', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('4', '186', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('5', '44', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('6', '56', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('7', '59', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('8', '68', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('9', '80', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('10', '83', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('11', '93', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('12', '98', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('13', '107', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('14', '115', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('15', '130', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('16', '132', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('17', '147', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('18', '160', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('19', '166', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('20', '177', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('21', '233', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('22', '234', '1', 'ACTIVE');
INSERT INTO `subject_group_qualitative_equivalence` (`serial_sgq`, `serial_sbc`, `serial_gqe`, `status_sgq`) VALUES ('23', '235', '1', 'ACTIVE');

INSERT INTO `subject_qualitative_equivalence` (`serial_sqe`, `serial_gqe`, `lower_percentage_sqe`, `higher_percentage_sqe`, `name_sqe`, `code_sqe`, `description_sqe`, `status_sqe`) VALUES ('1', '1', '90', '100', 'Positiva', 'P', 'El grupo evidencia comportamientos, actitudes y situaciones que se ajustan a lo descrito en la tabla de progresión según el subnivel señalado', 'ACTIVE');
INSERT INTO `subject_qualitative_equivalence` (`serial_sqe`, `serial_gqe`, `lower_percentage_sqe`, `higher_percentage_sqe`, `name_sqe`, `code_sqe`, `description_sqe`, `status_sqe`) VALUES ('2', '1', '70', '89.99', 'Media', 'M', 'El grupo evidencia comportamientos, actitudes y situaciones que manifiestan ciertas dificultades frente a lo establecido en la tabla de progresión según el subnivel señalado.', 'ACTIVE');
INSERT INTO `subject_qualitative_equivalence` (`serial_sqe`, `serial_gqe`, `lower_percentage_sqe`, `higher_percentage_sqe`, `name_sqe`, `code_sqe`, `description_sqe`, `status_sqe`) VALUES ('3', '1', '0', '69.99', 'Critica', 'C', 'El grupo manifiesta comportamientos, actitudes y situaciones que evidencian lo opuesto a lo señalado en la tabla de progresión según el subnivel señalado.', 'ACTIVE');



