python script to compare two database tables