In my database, I have a default table (called "mytable") that I download from the Internet. The table shows 100 rows and 10 columns (fields).
I am changing some values in the table, but I am not deleting or inserting either rows or columns.
Let's say in the fifth row of the table I change the value of the "Name" field from "Fox" to "Bear".
Then I download the table again from the Internet, and I add it to the database with a different name.
So, now I have the tables "oldtable" (containing default values) and "mytable", where only the field in one row is changed.
Now I want to show others what I changed in the database and provide them with a SQL script that they can run so that they apply the same changes. I cannot give them my “my table” because they cannot use it. They also have it, and they have changed some of the values in it as they see fit. They do not want my table, they just want to apply the changes that I made, in addition to the changes that they have already made in the table.
Therefore, I can give them this file named "patch.sql":
connect myDatabase;
update mytable set name="Bear" where name like "Fox";
However, I would like to create such a file “patch.sql” automatically, so I don’t need to remember what I changed and write a script manually. The program can check the differences between the two tables and automatically generate this SQL file.
Is it possible to do this in the MySQL console or with any other existing tool?
: .