Disclaimer : I'm new to relational databases, I'm using mysql.

I have two SQL databases which have about 70% tables in common, in which about 70% of fields are common. It could make sense to have only one database.

In C++, I would use inheritance to describe the data structure of the common data, and then use two different childs to represent what's different.

How is this kind of architecture is usually implemented with relational databases ?

Below is a simple example to illustrate.

This is DB A :


This is DB B :


What are the generic steps to follow to merge them? I would like to keep a clean structure.

1 Answer 1


The usual way is to add all the column into the merged tables and leave unused columns null.

In practice, you should also consider how data are merged in the new DB: How to identify the same person or running session? What to do if there are conflict (e.g., same person has different age in different DB)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.