separate sql interfaces and criteria