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 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
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 AccountStep 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