text: -- MySQL Script generated by MySQL Workbench
  -- Wed Jun 17 16:01:03 2020
  -- 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 dchoi933_film_db
  -- -----------------------------------------------------
  
  -- -----------------------------------------------------
  -- Schema dchoi933_film_db
  -- -----------------------------------------------------
  CREATE SCHEMA IF NOT EXISTS `dchoi933_film_db` DEFAULT CHARACTER SET utf8 ;
  USE `dchoi933_film_db` ;
  
  -- -----------------------------------------------------
  -- Table `dchoi933_film_db`.`director`
  -- -----------------------------------------------------
  DROP TABLE IF EXISTS `dchoi933_film_db`.`director` ;
  
  CREATE TABLE IF NOT EXISTS `dchoi933_film_db`.`director` (
    `id` INT NOT NULL,
    `name` VARCHAR(255) NULL,
    `email` VARCHAR(255) NULL,
    `birthdate` YEAR NULL,
    PRIMARY KEY (`id`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `dchoi933_film_db`.`film`
  -- -----------------------------------------------------
  DROP TABLE IF EXISTS `dchoi933_film_db`.`film` ;
  
  CREATE TABLE IF NOT EXISTS `dchoi933_film_db`.`film` (
    `id` INT NOT NULL,
    `title` VARCHAR(255) NULL,
    `year` YEAR NULL,
    `worldwide_gross` BIGINT NULL,
    `director_id` INT NULL,
    PRIMARY KEY (`id`),
    INDEX `fk_film_director_idx` (`director_id` ASC),
    CONSTRAINT `fk_film_director`
      FOREIGN KEY (`director_id`)
      REFERENCES `dchoi933_film_db`.`director` (`id`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  SET SQL_MODE=@OLD_SQL_MODE;
  SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
  SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
  
  -- -----------------------------------------------------
  -- Data for table `dchoi933_film_db`.`director`
  -- -----------------------------------------------------
  START TRANSACTION;
  USE `dchoi933_film_db`;
  INSERT INTO `dchoi933_film_db`.`director` (`id`, `name`, `email`, `birthdate`) VALUES (1, 'Anthony Russo', 'russo@gmail.com', 1970-02-03);
  INSERT INTO `dchoi933_film_db`.`director` (`id`, `name`, `email`, `birthdate`) VALUES (2, 'James Cameron', 'james@gmail.com', 1956-02-14);
  INSERT INTO `dchoi933_film_db`.`director` (`id`, `name`, `email`, `birthdate`) VALUES (3, 'J. J. Abrams', 'abrams@aol.com', 1967-03-05);
  INSERT INTO `dchoi933_film_db`.`director` (`id`, `name`, `email`, `birthdate`) VALUES (4, 'Colin Trevorrow', 'colin@yahoo.com', 1958-08-25);
  INSERT INTO `dchoi933_film_db`.`director` (`id`, `name`, `email`, `birthdate`) VALUES (5, 'Jon Favreau', 'jon@fav.com', 1966-10-19);
  INSERT INTO `dchoi933_film_db`.`director` (`id`, `name`, `email`, `birthdate`) VALUES (6, 'Joss Whedon', 'joss@usc.edu', 1972-10-03);
  
  COMMIT;
  
  
  -- -----------------------------------------------------
  -- Data for table `dchoi933_film_db`.`film`
  -- -----------------------------------------------------
  START TRANSACTION;
  USE `dchoi933_film_db`;
  INSERT INTO `dchoi933_film_db`.`film` (`id`, `title`, `year`, `worldwide_gross`, `director_id`) VALUES (1, 'Avengers: Endgame', 2019, 2796258402, 1);
  INSERT INTO `dchoi933_film_db`.`film` (`id`, `title`, `year`, `worldwide_gross`, `director_id`) VALUES (2, 'Avatar', 2009, 2787965087, 2);
  INSERT INTO `dchoi933_film_db`.`film` (`id`, `title`, `year`, `worldwide_gross`, `director_id`) VALUES (3, 'Titanic', 1997, 2186772302, 2);
  INSERT INTO `dchoi933_film_db`.`film` (`id`, `title`, `year`, `worldwide_gross`, `director_id`) VALUES (4, 'Star Wars: The Force Awakens', 2015, 2068223624, 3);
  INSERT INTO `dchoi933_film_db`.`film` (`id`, `title`, `year`, `worldwide_gross`, `director_id`) VALUES (5, 'Jurassic World', 2015, 1671713208, 4);
  INSERT INTO `dchoi933_film_db`.`film` (`id`, `title`, `year`, `worldwide_gross`, `director_id`) VALUES (6, 'The Lion King', 2019, 1564474294, 5);
  INSERT INTO `dchoi933_film_db`.`film` (`id`, `title`, `year`, `worldwide_gross`, `director_id`) VALUES (7, 'The Avengers', 2012, 1518812988, 6);
  
  COMMIT;
  
  