SELECT * FROM EMP;

 SELECT EMPNO
      ,ENAME
      ,dept_no
      ,SAL
      ,SUM(sal) over(ORDER BY empno) AS dept_cum
  FROM EMP
 ORDER BY empno;

Lets group the Cumulative Sum Based on DepartmentId

SELECT EMPNO
      ,ENAME
      ,dept_no
      ,SAL
      ,SUM(sal) over(PARTITION BY dept_no ORDER BY empno) AS dept_cum
  FROM EMP
 ORDER BY empno;

SELECT A.PinCode
      ,A.Location
      ,A.Year
      ,SUM(CASE
             WHEN A.Area IN ('North Chennai', 'South Chennai') THEN
              A.Amount
             ELSE
              0
           END) AS total_amount_north_south
      ,SUM(CASE
             WHEN A.Area IN ('East Chennai', 'West Chennai') THEN
              A.Amount
             ELSE
              0
           END) AS total_amount_east_west
      ,SUM(A.Amount) AS Total_amount_for_Chennai
  FROM Tamilnadu 
 GROUP BY A.PinCode
	 ,A.Location
         ,A.Year