Tredence interview question

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