Hello, Imagine you have a simple database with two tables, and a third to join them as a many-to-many relationship. Someone sends me an SQLite database as a file which has the same structure, but the data is different. I want to merge these two databases together keeping all of the relationships intact, without duplicating data.
For example, if the tables were "customers" and "products" and the one in between "orders", there is the possibility that some customers and/or products might be the same, but with different primary keys. The problem is that since the databases were independently created, a simple union will break the relationships since the primary keys will overlap. I can think of brute force ways to do this, but I was wondering if anyone might have a good algorithm or technique to accomplish this efficiently. Cheers! Demitri

