Question: database refactoring Consider the following database relations, compare the original table and new tables, identify the steps to change the original table to the new

database refactoring Consider the following database relations, compare the original table anddatabase refactoring

Consider the following database relations, compare the original table and new tables, identify the steps to change the original table to the new tables:

1. name the refactoring pattern(s) you use for every step. Multiple patterns may apply.

2. list every step in the order of changing from the original table structure into new table structure.

3. schema update and data migration mechanics: include the operations in words and SQL scripts needed to achieve the desired objective for each step

4. Execute your SQL scripts in a database platform and show the result

EXAMPLE

new tables, identify the steps to change the original table to the

Examples -Modify the database schema -Migrate data -Steps: Add Balance column to Account table -ALTER TABLE Account ADD Balance Number; Migrate Balance data -Move of Customer.Balance column to Account.Balance /*One time migration of data*/ UPDATE Account SET Balance = (SELECT Balance FROM Customer WHERE CustomerID = Account.CustomerID); Drop Balance column from Customer table -ALTER TABLE Customer DROP COLUMN Balance;

Original Student_UnitCode Relations: New Relations: Student_UnitCode table and Unit table Examples Structural Refactoring Figure 3.1. Moving the Customer.Balance column to Account. How to move Balance column from Customer to Account

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!