generalizing sql.. not done.