Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1006405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:27:19+00:00 2026-05-16T08:27:19+00:00

I have a database table called A and now i have create a new

  • 0

I have a database table called A and now i have create a new table called B and create some columns of A in table B.

Eg: Suppose following columns in tables

Table A // The one already exists

Id, Country Age Firstname, Middlename, Lastname

Table B // The new table I create

Id Firstname Middlename Lastname

Now the table A will be look like,

Table A // new table A after the modification

Id, Country, Age, Name

In this case it will map with table B..

So my problem is now i need to kind of maintain the reports which were generated before the table modifications and my friend told me you need to have a data migration..so may i know what is data migration and how its work please.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:27:20+00:00Added an answer on May 16, 2026 at 8:27 am

    Update

    I forgot to address the reporting issue raised by the OP (Thanks Mark Bannister). Here is a stab at how to deal with reporting.

    In the beginning (before data migration) a report to generate the name, country and age of users would use the following SQL (more or less):

    -- This query orders users by their Lastname
    SELECT Lastname, Firstname, Age, Country FROM tableA order by Lastname;
    

    The name related fields are no longer present in tableA post data migration. We will have to perform a join with tableB to get the information. The query now changes to:

    SELECT b.Lastname, b.Firstname, a.Country, a.Age FROM tableA a, tableB b
    WHERE a.name = b.id ORDER BY b.Lastname;  
    

    I don’t know how exactly you generate your report but this is the essence of the changes you will have to make to get your reports working again.

    Original Answer

    Consider the situation when you had only one table (table A). A couple of rows in the table would look like this:

    # Picture 1
    # Table A
    ------------------------------------------------------
    Id | Country | Age | Firstname | Middlename | Lastname
    1  | US      | 45  | John      | Fuller     | Doe
    2  | UK      | 32  | Jane      | Margaret   | Smith
    

    After you add the second table (table B) the name related fields are moved from table A to table B. Table A will have a foreign key pointing to the table B corresponding to each row.

    # Picture 2
    # Table A
    ------------------------------------------------------
    Id | Country | Age | Name
    1  | US      | 45  | 10
    2  | UK      | 32  | 11
    
    # Table B
    ------------------------------------------------------
    Id | Firstname | Middlename | Lastname
    10 | John      | Fuller     | Doe
    11 | Jane      | Margaret   | Smit
    

    This is the final picture. The catch is that the data will not move from table A to table B on its own. Alas human intervention is required to accomplish this. If I were the said human I would follow the steps given below:

    1. Create table B with columns Id, Firstname, Middlename and Lastname. You now have two tables A and B. A has all the existing data, B is empty .
    2. Add a foreign key to table A. This FK will be called name and will reference the id field of table B.
    3. For each row in table A create a new row in table B using the Firstname, Middlename and Lastname fields taken from table A.
    4. After copying each row, update the name field of table A with the id of the newly created row in table B.

    The database now looks like this:

    # Table A
    -------------------------------------------------------------
    Id | Country | Age | Firstname | Middlename | Lastname | Name
    1  | US      | 45  | John      | Fuller     | Doe      | 10
    2  | UK      | 32  | Jane      | Margaret   | Smith    | 11
    
    # Table B
    ------------------------------------------------------
    Id | Firstname | Middlename | Lastname
    10 | John      | Fuller     | Doe
    11 | Jane      | Margaret   | Smith
    
    1. Now you no longer need the Firstname, Middlename and Lastname columns in table A so you can drop them.
    2. voilà, you have performed a data migration!

    The process I just described above is but a specific example of a data migration. You can accomplish it in a number of ways using a number of languages/tools. The choice of mechanism will vary from case to case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have a database called 'lms' with two tables loan and value, table loan
I have a MySQL database table called Participant that looks something like this: (idParticipant)
I have a database table with a column called 'symbol', that is unique via
In database table I have column called options . It has type of integer
I have a table called Products in my database. It has a couple of
I have a table called routes within my database where each route has an
I have a lookup table called metadata_types in my database, which lists all the
Say I have a database called Poll and have these two table structures. poll
I have a MySQL Database. In it's table is a field called 'itm_name' I'm
I'm binding a gridview dynamically from a table in my database I have called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.