For each department with more than one member of employee, find the sum of reward amounts for each department by use (Having).
Instructions:
Write the suitable SQL statement to answer the following questions based on the following tables ( image for better table)
Table Name: Employee
EMP_ID FNAME LNAME SALARY JOIN_DATE DEP_NO
101 John Abraham 10000 01-JAN-13 11
202 Michael Clarke 80000 01-JAN-13 22
303 Roy Thomas 70000 01-FEB-13 11
404 Tom Jose 60000 01-FEB-13 22
505 Jerry Pinto 65000 01-FEB-13 22
606 Philip Mathew 75000 01-JAN-13 33
707 Thomas Jack 65000 01-JAN-13 33
Table Name: Reward
EMP_ID REWARD_DATE AMOUNT
101 01-FEB-13 5000
202 01-FEB-13 3000
303 01-FEB-13 4000
101 01-JAN-13 4500
202 01-JAN-13 3500
Table Name: Department
DEP_NO DEP_NAME
11 Banking
22 Insurance
33 Services
44 Marketing
the question is:
4. For each department with more than one member of employee, find the sum of reward amounts for each department by use (Having).
Step by step
Solved in 2 steps with 1 images