Dropping table & Creating the Same table then inserting data into Table, Table name is "EMP_CUSTOM_TABLE"
Inserting data into table using insert statements.
WE ARE GETTING TOTAL SALARY IN THE TABLE BY USING ANALYTICAL FUNCTION WITOUT PARTITION.
---------------------
HERE WE ARE GETTING DEPT TOTAL SALARY & RUNNUNG TOTAL OF SALRY WITH IN DEPT.
IF WE SPECIFY ORDER BY THEN IT FOLLOWS RUNNING SUM ELSE TOTAL OF DEPT.
FINALLY AT THE END OF THE DEPT WE ARE GETTING SAME TOTAL SALRY OF THE DEPT. ( It is highlighted in the below screen shot.)
--------------------------------
HIGHLIGHTED ROWS WERE SUMMED UP SINCE BOTH ARE HAVING THE SAME SALARY AND BELONGING TO THE SAME DEPT.
WE ARE APPLYING PARTITION BY DEPTNO ORDER BY DEPTNO ASC,SAL DESC; IT MEANS SALARIES ARE SAME & BELONGONG TO THE SAME DEPT SO VALUES ARE BEING SUMMED UP.
HERE WE ARE SPECIFYING ENAME IN THE ORDER BY CLAUSE SO VALUES ARE BEING SUMMED UP ACCORDINGLY, IT MEANS DEPT IS SAME BUT ENAMES ARE DIFFERENT.