Teradata SQL Test – 2
We have an EmployeeSalary Table which holds information about Employee and the Salary which the Employee is getting in respective months. The table is holding the data for past six months. Below is the snapshot of the EMP_SAL table:
Now we need to write an SQL Query which can retrieve the name of EMPLOYEES who have received more than INR 120,000 in total as their SAL in last six months. The answer as per the snapshot of the table is RAJ
Can you write the correct query? Leave your SQL Query as comment below. There may be several ways of getting the desired output. You can check the answer on ANSWERS PAGE too. However for better understanding of Teradata SQL , it is suggested that you leave a comment below with your SQL Query and then check our answer. We may get better and more ways of getting the same result.
Hint: Try it via GROUP BY HAVING clause