i need to know how i display department which has salary >
=5000 for the below table
Department
-----------
salary deptname
1000 a
3000 a
2000 b
3000 b
4000 c
5000 c
kindly send the query to thilakvinoth13@gmail.com
Answer Posted / mahesh
Hi dear,
1) If you have need name of total salary of each department to spend on employee(Understand like this) then use query:
select deptname, SUM(salary)
from Department
GROUP BY deptname
HAVING SUM(salary) >= 5000;
2) Otherwise
SELECT deptname
FROM Department
WHERE salary >= 5000;
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
List some advantages and disadvantages of stored procedure?
OPTIMIZATION OF SP,CURSOR,TRIGGERS
What are the components of dbms?
Can we use pragma autonomous_transaction in trigger?
What are the disadvantages of using querystrings to send data from one page to another?
What does it mean to be in union?
What is buffer cash in sql server?
What is report subscription?
what authentication modes does sql server support? : Sql server database administration
What is meant by Active-Passive and Active-Active clustering setup?
Where is my database stored on the hard disk in ms sql server?
if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration
To automatically record the time on which the data was modified in a table, which data type should you choose for the column?
Can you force a query to use a specific index?
How can we use ConnectorJ JDBC Driver with MS SQL?