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
how many triggers you can have on a table? : Sql server database administration
What is the difference between coalesce() & isnull()?
What is the report builder?
how to control the amount of free space in your index pages? : Sql server database administration
What is a primary index?
What is the difference between nvl and nvl2?
How to count duplicated values in a column in ms sql server?
what's sql server? : Sql server database administration
Difference between DELETE and TRUNCATE?
What is CTE in SQL
You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?
how to restart sql server in single user mode? How to start sql server in minimal configuration mode? : Sql server database administration
how to avoid cursors? : Sql server database administration
What are the steps to take to improve performance of a poor performing query? : sql server database administration
what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration