android app database scripts. also a more efficient sql query for getting max/min/avg