Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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='TRADITIONAL,ALLOW_INVALID_DATES';
- DROP SCHEMA IF EXISTS `cat10e` ;
- CREATE SCHEMA IF NOT EXISTS `cat10e` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
- SHOW WARNINGS;
- USE `cat10e` ;
- -- -----------------------------------------------------
- -- Table `cat10e`.`artist`
- -- -----------------------------------------------------
- DROP TABLE IF EXISTS `cat10e`.`artist` ;
- SHOW WARNINGS;
- CREATE TABLE IF NOT EXISTS `cat10e`.`artist` (
- `art_id` SMALLINT NOT NULL,
- `art_name` VARCHAR(45) NOT NULL,
- `art_url` VARCHAR(100) NOT NULL,
- `art_note` VARCHAR(255) NOT NULL,
- PRIMARY KEY (`art_id`))
- ENGINE = InnoDB;
- SHOW WARNINGS;
- -- -----------------------------------------------------
- -- Table `cat10e`.`label`
- -- -----------------------------------------------------
- DROP TABLE IF EXISTS `cat10e`.`label` ;
- SHOW WARNINGS;
- CREATE TABLE IF NOT EXISTS `cat10e`.`label` (
- `label_id` TINYINT NOT NULL,
- `label_type` ENUM('m', 'n', 'i') NOT NULL,
- `label_name` VARCHAR(45) NOT NULL,
- `label_street` VARCHAR(30) NOT NULL,
- `label_city` VARCHAR(20) NOT NULL,
- `label_state` VARCHAR(2) NOT NULL,
- `label_zip` CHAR(9) NOT NULL,
- `label_url` VARCHAR(100) NOT NULL,
- `label_note` VARCHAR(255) NULL,
- PRIMARY KEY (`label_id`))
- ENGINE = InnoDB;
- SHOW WARNINGS;
- -- -----------------------------------------------------
- -- Table `cat10e`.`album`
- -- -----------------------------------------------------
- DROP TABLE IF EXISTS `cat10e`.`album` ;
- SHOW WARNINGS;
- CREATE TABLE IF NOT EXISTS `cat10e`.`album` (
- `album_id` SMALLINT NOT NULL,
- `art_id` SMALLINT NOT NULL,
- `label_id` TINYINT NOT NULL,
- `album_name` VARCHAR(45) NOT NULL,
- `album_cost` DECIMAL(4,2) NOT NULL,
- `album_tracks` TINYINT NOT NULL,
- `album_rating` DECIMAL(2,1) NOT NULL,
- `album_producer` VARCHAR(45) NOT NULL,
- `album_genre` VARCHAR(45) NOT NULL,
- `album_note` VARCHAR(255) NULL,
- PRIMARY KEY (`album_id`, `art_id`, `label_id`),
- INDEX `fk_album_artist_idx` (`art_id` ASC),
- INDEX `fk_album_label1_idx` (`label_id` ASC),
- CONSTRAINT `fk_album_artist`
- FOREIGN KEY (`art_id`)
- REFERENCES `cat10e`.`artist` (`art_id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION,
- CONSTRAINT `fk_album_label1`
- FOREIGN KEY (`label_id`)
- REFERENCES `cat10e`.`label` (`label_id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION)
- ENGINE = InnoDB;
- SHOW WARNINGS;
- -- -----------------------------------------------------
- -- Table `cat10e`.`recording`
- -- -----------------------------------------------------
- DROP TABLE IF EXISTS `cat10e`.`recording` ;
- SHOW WARNINGS;
- CREATE TABLE IF NOT EXISTS `cat10e`.`recording` (
- `rec_id` SMALLINT NOT NULL,
- `album_id` SMALLINT NOT NULL,
- `rec_duration` TIME NOT NULL,
- `rec_genre` VARCHAR(45) NOT NULL,
- `rec_cost` DECIMAL(4,2) NOT NULL,
- `rec_title` VARCHAR(45) NOT NULL,
- `rec_date` DATE NOT NULL,
- `rec_note` VARCHAR(255) NULL,
- PRIMARY KEY (`rec_id`, `album_id`),
- INDEX `fk_recording_album1_idx` (`album_id` ASC),
- CONSTRAINT `fk_recording_album1`
- FOREIGN KEY (`album_id`)
- REFERENCES `cat10e`.`album` (`album_id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION)
- ENGINE = InnoDB;
- SHOW WARNINGS;
- -- -----------------------------------------------------
- -- Table `cat10e`.`format`
- -- -----------------------------------------------------
- DROP TABLE IF EXISTS `cat10e`.`format` ;
- SHOW WARNINGS;
- CREATE TABLE IF NOT EXISTS `cat10e`.`format` (
- `format_id` SMALLINT NOT NULL,
- `rec_id` SMALLINT NOT NULL,
- `format_type` VARCHAR(15) NOT NULL,
- `format_note` VARCHAR(255) NULL,
- PRIMARY KEY (`format_id`, `rec_id`),
- INDEX `fk_format_recording1_idx` (`rec_id` ASC),
- CONSTRAINT `fk_format_recording1`
- FOREIGN KEY (`rec_id`)
- REFERENCES `cat10e`.`recording` (`rec_id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION)
- ENGINE = InnoDB;
- SHOW WARNINGS;
- -- -----------------------------------------------------
- -- Table `cat10e`.`member`
- -- -----------------------------------------------------
- DROP TABLE IF EXISTS `cat10e`.`member` ;
- SHOW WARNINGS;
- CREATE TABLE IF NOT EXISTS `cat10e`.`member` (
- `mem_id` SMALLINT NOT NULL,
- `mem_fname` VARCHAR(20) NOT NULL,
- `mem_lname` VARCHAR(30) NOT NULL,
- `mem_note` VARCHAR(255) NOT NULL,
- PRIMARY KEY (`mem_id`))
- ENGINE = InnoDB;
- SHOW WARNINGS;
- -- -----------------------------------------------------
- -- Table `cat10e`.`participant`
- -- -----------------------------------------------------
- DROP TABLE IF EXISTS `cat10e`.`participant` ;
- SHOW WARNINGS;
- CREATE TABLE IF NOT EXISTS `cat10e`.`participant` (
- `art_id` SMALLINT NOT NULL,
- `mem_id` SMALLINT NOT NULL,
- `part_startdate` DATE NOT NULL,
- `part_enddate` DATE NOT NULL,
- PRIMARY KEY (`art_id`, `mem_id`),
- INDEX `fk_participant_artist1_idx` (`art_id` ASC),
- INDEX `fk_participant_member1_idx` (`mem_id` ASC),
- CONSTRAINT `fk_participant_artist1`
- FOREIGN KEY (`art_id`)
- REFERENCES `cat10e`.`artist` (`art_id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION,
- CONSTRAINT `fk_participant_member1`
- FOREIGN KEY (`mem_id`)
- REFERENCES `cat10e`.`member` (`mem_id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION)
- ENGINE = InnoDB;
- SHOW WARNINGS;
- SET SQL_MODE=@OLD_SQL_MODE;
- SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
- SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
- -- -----------------------------------------------------
- -- Data for table `cat10e`.`album`
- -- -----------------------------------------------------
- START TRANSACTION;
- USE `cat10e`;
- INSERT INTO `cat10e`.`album` (`album_id`, `art_id`, `label_id`, `album_name`, `album_cost`, `album_tracks`, `album_rating`, `album_producer`, `album_genre`, `album_note`) VALUES (1, 1, 1, 'legends of country', 55.55, 4, 4, 'poor jim', 'country', NULL);
- INSERT INTO `cat10e`.`album` (`album_id`, `art_id`, `label_id`, `album_name`, `album_cost`, `album_tracks`, `album_rating`, `album_producer`, `album_genre`, `album_note`) VALUES (2, 2, 2, 'legends of rock', 22.22, 5, 8, 'rich joe', 'rock', NULL);
- INSERT INTO `cat10e`.`album` (`album_id`, `art_id`, `label_id`, `album_name`, `album_cost`, `album_tracks`, `album_rating`, `album_producer`, `album_genre`, `album_note`) VALUES (3, 3, 3, 'legends of rock vol2', 22.22, 5, 9, 'rocker inc', 'rock', NULL);
- INSERT INTO `cat10e`.`album` (`album_id`, `art_id`, `label_id`, `album_name`, `album_cost`, `album_tracks`, `album_rating`, `album_producer`, `album_genre`, `album_note`) VALUES (4, 4, 4, 'legends of rap', 66.66, 8, 8, 'hip hop lords', 'hip hop', NULL);
- INSERT INTO `cat10e`.`album` (`album_id`, `art_id`, `label_id`, `album_name`, `album_cost`, `album_tracks`, `album_rating`, `album_producer`, `album_genre`, `album_note`) VALUES (5, 5, 5, 'random noises', 11.11, 1, 1, 'worst guys', 'dubstep', NULL);
- COMMIT;
- -- -----------------------------------------------------
- -- Data for table `cat10e`.`recording`
- -- -----------------------------------------------------
- START TRANSACTION;
- USE `cat10e`;
- INSERT INTO `cat10e`.`recording` (`rec_id`, `album_id`, `rec_duration`, `rec_genre`, `rec_cost`, `rec_title`, `rec_date`, `rec_note`) VALUES (1, 1, '00:05:43', 'country', 23.45, 'country roads', '1992-02-04', NULL);
- INSERT INTO `cat10e`.`recording` (`rec_id`, `album_id`, `rec_duration`, `rec_genre`, `rec_cost`, `rec_title`, `rec_date`, `rec_note`) VALUES (2, 2, '00:04:22', 'rock', 45.65, 'one', '2001-04-04', NULL);
- INSERT INTO `cat10e`.`recording` (`rec_id`, `album_id`, `rec_duration`, `rec_genre`, `rec_cost`, `rec_title`, `rec_date`, `rec_note`) VALUES (3, 3, '01:00:00', 'rock', 99.23, 'stairway to heaven', '1999-05-09', NULL);
- INSERT INTO `cat10e`.`recording` (`rec_id`, `album_id`, `rec_duration`, `rec_genre`, `rec_cost`, `rec_title`, `rec_date`, `rec_note`) VALUES (4, 4, '00:02:01', 'hiphop', 55.32, 'juicy', '1995-01-02', NULL);
- INSERT INTO `cat10e`.`recording` (`rec_id`, `album_id`, `rec_duration`, `rec_genre`, `rec_cost`, `rec_title`, `rec_date`, `rec_note`) VALUES (5, 5, '00:00:01', 'dubstep', 67.87, 'shortest song ever', '2014-04-01', NULL);
- COMMIT;
- -- -----------------------------------------------------
- -- Data for table `cat10e`.`format`
- -- -----------------------------------------------------
- START TRANSACTION;
- USE `cat10e`;
- INSERT INTO `cat10e`.`format` (`format_id`, `rec_id`, `format_type`, `format_note`) VALUES (1, 1, 'mp3', NULL);
- INSERT INTO `cat10e`.`format` (`format_id`, `rec_id`, `format_type`, `format_note`) VALUES (2, 2, 'wav', NULL);
- INSERT INTO `cat10e`.`format` (`format_id`, `rec_id`, `format_type`, `format_note`) VALUES (3, 3, 'mp4', NULL);
- INSERT INTO `cat10e`.`format` (`format_id`, `rec_id`, `format_type`, `format_note`) VALUES (4, 4, 'oggvorbis', NULL);
- INSERT INTO `cat10e`.`format` (`format_id`, `rec_id`, `format_type`, `format_note`) VALUES (5, 5, 'divx', NULL);
- COMMIT;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement