some utility sql