-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -----------------------------------------------------
-- Schema msa
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema msa
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `msa` DEFAULT CHARACTER SET utf8 ;
-- -----------------------------------------------------
-- Schema pro
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema pro
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `pro` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ;
USE `msa` ;
-- -----------------------------------------------------
-- Table `msa`.`ranking`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `msa`.`ranking` (
`Bidx` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NULL,
`score` INT NULL,
`bonus` INT NULL,
`total` INT NULL,
PRIMARY KEY (`Bidx`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `msa`.`question`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `msa`.`question` (
`idx` INT NOT NULL,
`a` INT NULL,
`b` INT NULL,
`result` INT NULL,
`Bidx` INT NULL,
PRIMARY KEY (`idx`),
INDEX `f_Bidx_idx` (`Bidx` ASC) VISIBLE,
CONSTRAINT `f_Bidx`
FOREIGN KEY (`Bidx`)
REFERENCES `msa`.`ranking` (`Bidx`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
USE `pro` ;
-- -----------------------------------------------------
-- Table `pro`.`inform`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pro`.`inform` (
`idx` INT NOT NULL AUTO_INCREMENT,
`username` VARCHAR(45) NULL DEFAULT NULL,
`factorA` INT NULL DEFAULT NULL,
`factorB` INT NULL DEFAULT NULL,
`checkAttempt` TINYINT NULL DEFAULT NULL,
PRIMARY KEY (`idx`))
ENGINE = InnoDB
AUTO_INCREMENT = 50
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;