Added SQL functions
Added SQL function