Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- MySQL Script generated by MySQL Workbench
- -- Thu Jun 13 16:17:35 2024
- -- Model: New Model Version: 1.0
- -- 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 hard_drive_db
- -- -----------------------------------------------------
- -- -----------------------------------------------------
- -- Schema hard_drive_db
- -- -----------------------------------------------------
- CREATE SCHEMA IF NOT EXISTS `hard_drive_db` DEFAULT CHARACTER SET utf8 ;
- USE `hard_drive_db` ;
- -- -----------------------------------------------------
- -- Table `hard_drive_db`.`serial_numbers`
- -- -----------------------------------------------------
- CREATE TABLE IF NOT EXISTS `hard_drive_db`.`serial_numbers` (
- `serial_number` TINYTEXT NOT NULL,
- `model` VARCHAR(255) NOT NULL,
- PRIMARY KEY (`serial_number`),
- UNIQUE INDEX `serial_number_UNIQUE` (`serial_number` ASC) VISIBLE)
- ENGINE = InnoDB;
- -- -----------------------------------------------------
- -- Table `hard_drive_db`.`producer`
- -- -----------------------------------------------------
- CREATE TABLE IF NOT EXISTS `hard_drive_db`.`producer` (
- `name_producer` VARCHAR(255) NOT NULL,
- `web-site` TINYTEXT NOT NULL,
- PRIMARY KEY (`name_producer`))
- ENGINE = InnoDB;
- -- -----------------------------------------------------
- -- Table `hard_drive_db`.`characteristics`
- -- -----------------------------------------------------
- CREATE TABLE IF NOT EXISTS `hard_drive_db`.`characteristics` (
- `model` VARCHAR(255) NOT NULL,
- `name_producer` VARCHAR(255) NOT NULL,
- `volume` VARCHAR(45) NOT NULL,
- `rotation_speed` VARCHAR(45) NOT NULL,
- `interface` VARCHAR(255) NULL,
- INDEX `characteristics_to_sn_idx` (`model` ASC) VISIBLE,
- INDEX `charesterictics_to_producer_idx` (`name_producer` ASC) VISIBLE,
- CONSTRAINT `characteristics_to_sn`
- FOREIGN KEY (`model`)
- REFERENCES `hard_drive_db`.`serial_numbers` (`serial_number`)
- ON DELETE CASCADE
- ON UPDATE CASCADE,
- CONSTRAINT `charesterictics_to_producer`
- FOREIGN KEY (`name_producer`)
- REFERENCES `hard_drive_db`.`producer` (`name_producer`)
- ON DELETE CASCADE
- ON UPDATE CASCADE)
- ENGINE = InnoDB;
- SET SQL_MODE=@OLD_SQL_MODE;
- SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
- SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement