Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the refactoring pattern used for following? I am using a MySQL database. The tables are as follows. Employee(EmpId, Name, Phone, Address) Department(DID, EmpId,

What is the refactoring pattern used for following? I am using a MySQL database. The tables are as follows.

Employee(EmpId, Name, Phone, Address)

Department(DID, EmpId, DName)

Primary keys are EmpId in Employee. DID in Department.

Foreign keys are EmpId in Department.

1. What refactor pattern should be used to remove a primary key(EmpId) and introduce a new primary key(Name and Phone)?

2. What refactor pattern should be used to drop the foreign key in Department(EmpId) and how to add the new columns(Name and Phone) as foreign keys in the department table.?

Can I drop the column(EmpId) directly in Department table or I need to first drop the foreign key constraint on EmpId and then drop that column?

3. What refactor pattern and how to add new foreign constraints(Name, Phone) in Department table?

And lastly is any data migration required during these changes?

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

Why do U.S GAPP and IFRS require absorption costing?

Answered: 1 week ago

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

=+2 Why are so many countries bothered by their brain drains?

Answered: 1 week ago