Pregunta de entrevista de Tredence

How to do pivoting in sql ? How to handle cumulative function in sql ?