Showing posts with label 172 ) 13 . SQL : query to show Total salary of each department. Show all posts
Showing posts with label 172 ) 13 . SQL : query to show Total salary of each department. Show all posts

Monday, August 10, 2026

172 ) 13 . SQL : query to show Total salary of each department

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

13 . SQL : query to show Total salary  of each department

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SELECT

      Id,   empname,   deptid,   Salary,

  SUM(Salary) OVER(PARTITION BY deptid) AS SUM_SAL

FROM

  emp  ORDER BY    id

 ===========================

# Id, empname, deptid, Salary, SUM_SAL

'1', 'john', '1', '20000', '50000'

'2', 'kem', '1', '30000', '50000'

'3', 'chan', '2', '10000', '30000'

'4', 'henry', '2', '20000', '30000'

'5', 'bill', '3', '30000', '30000'

'6', 'salt', '4', '20000', '20000'


212 What is Medallion Architecture?

 212 What is Medallion Architecture? Medallion Architecture is a data design pattern used to logically organize data in a data lake or lakeh...