added sql testing code