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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!