Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribeddatabase 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

image text in transcribed

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

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

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions

Question

Should there be an insanity defense?

Answered: 1 week ago