Question
Kindly explain How to use MYSQL DDL statement to Reverse engineer a Logical ER diagram, showing the entities, attributes and relationships with the appropriate multiplicities.
Kindly explain How to use MYSQL DDL statement to Reverse engineer a Logical ER diagram, showing the entities, attributes and relationships with the appropriate multiplicities.
DDL STATEMENT
CREATE TABLE `range` (
`r_id` INT NOT NULL AUTO_INCREMENT,
`r_name` VARCHAR(16) NULL,
PRIMARY KEY (`r_id`))
ENGINE = InnoDB;
CREATE TABLE `type` (
`t_id` INT NOT NULL AUTO_INCREMENT,
`t_name` VARCHAR(16) NOT NULL,
`fk_r_id` INT NOT NULL,
PRIMARY KEY (`t_id`),
CONSTRAINT `fk_r_id`
FOREIGN KEY (`fk_r_id`)REFERENCES `range` (`r_id`)
ENGINE = InnoDB;
CREATE TABLE `product` (
`p_id` INT NOT NULL AUTO_INCREMENT,
`p_name` VARCHAR(48) NOT NULL,
PRIMARY KEY (`p_id`))
ENGINE = InnoDB;
CREATE TABLE `product_type` (
`fk_p_id` INT NULL,
`fk_t_id` INT NULL,
`desc` VARCHAR(128) NOT NULL,
`price` DECIMAL(6,2) NOT NULL,
`quantity` VARCHAR(12) NOT NULL,
PRIMARY KEY (`fk_p_id`, `fk_t_id`),
CONSTRAINT `fk_p_id`
FOREIGN KEY (`fk_p_id`) REFERENCES `product` (`p_id`)
CONSTRAINT `fk_t_id`
FOREIGN KEY (`fk_t_id`) REFERENCES `type` (`t_id`)
ENGINE = InnoDB;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started