1.       “XXX_Civiccenter_create.sql”  where XXX are your initials. 

1.       “XXX_Civiccenter_create.sql”  where XXX are your initials.  This is an SQL script which will drop any pre-existing Civic Center schema and create all the tables, keys, and other structures you will need.  If we run this script, it should remove any existing civiccenter schema and create yours. 



honeyd


12-09-20 | 15:46:23

-- 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 CivicCenter -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `CivicCenter` ; -- ----------------------------------------------------- -- Schema CivicCenter -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `CivicCenter` DEFAULT CHARACTER SET utf8 ; USE `CivicCenter` ; -- ----------------------------------------------------- -- Table `CivicCenter`.`customer` -- ----------------------------------------------------- DROP TABLE IF EXISTS `CivicCenter`.`customer` ; CREATE TABLE IF NOT EXISTS `CivicCenter`.`customer` ( `idcustomer` INT NOT NULL AUTO_INCREMENT, `Name` VARCHAR(45) NULL, PRIMARY KEY (`idcustomer`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `CivicCenter`.`Opera` -- ----------------------------------------------------- DROP TABLE IF EXISTS `CivicCenter`.`Opera` ; CREATE TABLE IF NOT EXISTS `CivicCenter`.`Opera` ( `idOpera` INT NOT NULL AUTO_INCREMENT, `Operaname` VARCHAR(45) NULL, `OperaCost` INT NULL, `PerformanceDate` DATE NULL, `Backstage` VARCHAR(45) NULL, `customer_idcustomer` INT NOT NULL, PRIMARY KEY (`idOpera`), INDEX `fk_Opera_customer_idx` (`customer_idcustomer` ASC), CONSTRAINT `fk_Opera_customer` FOREIGN KEY (`customer_idcustomer`) REFERENCES `CivicCenter`.`customer` (`idcustomer`) 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;

Login to answer this question!