Tredence Interview Question

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