check db and table together