Edit SQL functions