Pregunta de entrevista de RBHU Analytics

How would write a function in sql?