Regroup sql/*.

Fixed sql errors.