Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

design a simple disciplinary and grievance procedure.

Answered: 1 week ago