You are on page 1of 3

Q-> Find the name of the employee, whose department location is his/her

home loans?
Employee table Department table

E_NO E_NAME ADDRESS D_No. Location E_No.


1 Ram Delhi D1 Delhi 1
2 Varun Chd
3 Ravi Chd D2 Pune 2
4 Aman Delhi D3 Patna 4

INPUT:-
select E_name
from employee join department
where department.location =employee.address
and department.E_no=employee.E_no;

OUTPUT:-
Q. Queries using aggregate functions(COUNT, SUM, AVG, MAX, MIN) Group by, Orderby .

E_id E_name Age Salary


101 Rohan 22 9000
102 Suman 29 8000
103 Harsh 34 6000
104 Kamal 44 10000
105 Hardik 35 8000
106 Virat 27 7000
107 Shardha 29 8000
1.Count the no. of employee from the employee table.

select count(E_name) from employee

2.Find the max and min age of employee.

select max(age) from employee

3.select min(age) from employee

4.Find grouped salary of employees

select Salary from Employee group by salary;


5.Find salaries of employee in ascending order.

select E_name,Salary from Employee order by salary;

You might also like