CREATE TABLE `exam_valuation_rule_formula` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `formulaName` VARCHAR(50) NULL,
  `formula` VARCHAR(500) NULL,
  PRIMARY KEY (`id`));
  
  
 CREATE TABLE `exam_valuation_rule_constant` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `constantName` VARCHAR(45) NULL,
  `constantValue` INT NULL,
  PRIMARY KEY (`id`));
  
  
  CREATE TABLE `exam_valuation_rule_relation` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `exam_valuation_rule_formula_id` INT NULL,
  `exam_registration_id` INT NULL,
  `exam_supplementary_id` INT NULL,
  PRIMARY KEY (`id`));
  
  ALTER TABLE `exam_valuation_rule_constant` 
CHANGE COLUMN `constantValue` `constantValue` FLOAT(5,2) NULL DEFAULT NULL ;

ALTER TABLE `exam_valuation_rule_constant` 
ADD UNIQUE INDEX `constantName_UNIQUE` (`constantName` ASC);
