Find the name of Department Whose Average salary is
less than 12,000.00
Mock table is this and Query corresponding to this table is Below
Dept_ID |
Emp_Name |
Emp_Gender |
Department |
Salarty |
1 |
David |
M |
IT |
10000.00 |
2 |
Smith |
M |
IT |
50000.00 |
3 |
Jhon |
M |
HR |
90000.00 |
4 |
Sam |
M |
HR |
60000.00 |
5 |
Ryan |
M |
IT |
5500.63 |
6 |
Jacob |
M |
ACC |
8000.00 |
7 |
Reshma |
F |
HR |
7000.36 |
8 |
Dyna |
F |
ACC |
8752.85 |
9 |
Nothan |
M |
IT |
20000.00 |
10 |
Chris |
M |
ACC |
15000.00 |
Declare @Department AS TABLE
(
Dept_ID int identity(1,1) primary key,
Emp_Name varchar(100),
Emp_Gender varchar(30),
Dept_Name varchar(20),
Salary decimal(9,2)
)
insert into @Department values('David','M','IT',10000)
insert into @Department values('Smith','M','IT',50000)
insert into @Department values('Jhon','M','HR',90000)
insert into @Department values('Sam','M','HR',60000)
insert into @Department values('Ryan','M','IT',5500.63)
insert into @Department values('Jacob','M','ACC',8000)
insert into @Department values('Reshma','F','HR',7000.36)
insert into @Department values('Dyna','F','ACC',8752.85)
insert into @Department values('Nothan','M','IT',20000)
insert into @Department values('Chris','M','ACC',15000)
SELECT * FROM @Department