Description
Take the data below and create a Model with functional dependencies.
- In a text/word file, write out the “Model” of your tables in the following format:
TABLE_NAME(Key, otherElements, etc.) (if there is a foreign key, italicize it)- You might want to add extra fields to make your database make more sense.
- Create a MySQL Model using MySQL Workbench of your tables & be sure to include the relationships and enter the data below.
- Please Call your Database LastNameFirstNameAssignment2
- Each table created should have a Primary Key, and data types for each element.
- Submit text/word document and database creation script (SQL)
Unformatted Attachment Preview
Purchase answer to see full attachment
Explanation & Answer
Convert fullscripts.txt to fullscript.sql by copying it to your mysql working since the website does not support .sql files uploads . there is also .mwb file which i did not find possible way to upload please contact support on how we will solve this as i also do so
STORES
PRIMARY KEY
StoreID
StoreName
STORE A
PRIMARY KEY InvoiceID
StoreID
BuyerLastName
BuyerFirstName
BuyerPhone
VendorPhone
InvoiceDate
InvoiceItem
Price
ItemVendor
STORE A
PRIMARY KEY InvoiceID
StoreID
BuyerLastName
BuyerFirstName
BuyerPhone
VendorPhone
InvoiceDate
InvoiceItem
Price
ItemVendor
STORE A
PRIMARY KEY InvoiceID
StoreID
BuyerLastName
BuyerFirstName
BuyerPhone
VendorPhone
InvoiceDate
InvoiceItem
Price
ItemVendor
Attached.
-- 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='TRADITIONAL,ALLOW_INVALID_DATES';
-- ------------------------------------------------------ Schema LastNameFirstNameAssignment2
-- ------------------------------------------------------ ------------------------------------------------------ Schema LastNameFirstNameAssignment2
-- ----------------------------------------------------CREATE SCHEMA IF NOT EXISTS `LastNameFirstNameAssignment2` DEFAULT CHARACTER SET
utf8 COLLATE utf8_general_ci ;
USE `LastNameFirstNameAssignment2` ;
-- ------------------------------------------------------ Table `LastNameFirstNameAssignment2`.`STORES`
-- ----------------------------------------------------CREATE TABLE IF NOT EXISTS `LastNameFirstNameAssignment2`.`STORES` (
`StoreID` INT NOT NULL COMMENT '',
`StoreName` VARCHAR(45) NOT NULL COMMENT '',
PRIMARY KEY (`StoreID`) COMMENT '',
UNIQUE INDEX `StoreName_UNIQUE` (`StoreName` ASC) COMMENT '')
ENGINE = InnoDB;
-- ------------------------------------------------------ Table `LastNameFirstNameAssignment2`.`ILoveLamps`
-- ----------------------------------------------------CREATE TABLE IF NOT EXISTS `LastNameFirstNameAssignment2`.`ILoveLamps` (
`InvoiceID` INT NOT NULL AUTO_INCREMENT COMMENT '',
`BuyerFirstName` VARCHAR(45) NOT NULL COMMENT '',
`BuyerLastName` VARCHAR(45) NOT NULL COMMENT '',
`BuyerPhone` VARCHAR(45) NOT NULL COMMENT '',
`VendorPhone` VARCHAR(45) NOT NULL COMMENT '',
`InvoiceDate` DATE NOT NULL COMMENT '',
`InvoiceItem` VARCHAR(45) NOT NULL COMMENT '',
`Price` INT NOT NULL COMMENT '',
`STORES_StoreID` INT NOT NULL DEFAULT 002 COMMENT '',
PRIMARY KEY (`InvoiceID`) COMMENT '',
INDEX `fk_ILoveLam...