Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE IF NOT EXISTS `agoravai`.`exam` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `year` INT NOT NULL,
- `creation_date` DATETIME NOT NULL,
- `teacher_name` VARCHAR(64) NOT NULL,
- `university_id` INT NOT NULL,
- `course_id` INT UNSIGNED NOT NULL,
- `discipline_id` INT UNSIGNED NOT NULL,
- `account_id` INT UNSIGNED NOT NULL,
- PRIMARY KEY (`id`),
- INDEX `fk_exam_discipline_idx` (`discipline_id` ASC),
- INDEX `fk_exam_account_idx` (`account_id` ASC),
- INDEX `fk_exam_course_idx` (`course_id` ASC),
- INDEX `fk_exam_university_idx` (`university_id` ASC),
- CONSTRAINT `fk_exam_discipline`
- FOREIGN KEY (`discipline_id`)
- REFERENCES `agoravai`.`discipline` (`id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION,
- CONSTRAINT `fk_exam_account`
- FOREIGN KEY (`account_id`)
- REFERENCES `agoravai`.`account` (`id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION,
- CONSTRAINT `fk_exam_course`
- FOREIGN KEY (`course_id`)
- REFERENCES `agoravai`.`course` (`id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION,
- CONSTRAINT `fk_exam_university`
- FOREIGN KEY (`university_id`)
- REFERENCES `agoravai`.`university` (`id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION)
- ENGINE = InnoDB;
Add Comment
Please, Sign In to add comment