Generalization of SQL functions