When new data have been received and prepared for merging into existing database tables, a review of the changes to be made is often warranted prior to merging the data. A set of execsql.py scripts to compare data in base and staging tables is available at https://osdn.net/projects/execsql-compare/. These scripts use the information_schema views of the database to identify primary key and attribute columns, and to generate the SQL to perform different types of comparisons. These scripts will therefore work without any customization on any table of any database for any of the supported DBMSs. Currently supported DBMSs are PostgreSQL, MariaDB/MySQL, and SQL Server.
More extensive documentation, including illustrations of the type of output that can be produced, is available at http://execsql-compare.osdn.io/.