some db analysis sql scripts