reformat SQL in misc/