(1) Write a query to display the last name and hire date of any employee in the
same department as SCOTT. Exclude SCOTT
==> select emp_name,hire_date from employee group by dept_no where emp_name!='an
amika';
(2) Give name of customers who are depositors having same branch city of mr. sun
il.
==> select cname from deposit where bname in(select bname from deposit where cna
me='sunil');
(3) Give deposit details and loan details of customer in same city where pramod
is living.
==> select * from deposit,loan where bname in(select bname from customers where
cname='PRAMOD');
(4) Create a query to display the employee numbers and last names of all employe
es who earn more than the average salary. Sort the results in ascending order of
salary.
==> select emp_name,emp_no from employee where emp_sal>(select avg(emp_sal) from
employee) order by emp_sal;
(5) Give names of depositors having same living city as mr. anil and having depo
sit amount greater than 2000
==> select cname from deposit where bname in(select bname from customers where c
name='sunil') and amount>2000;
(6) Display the last name and salary of every employee who reports to ford.
==> select cname from employee
(8) List the name of branch having highest number of depositors.
==> select bname from deposit where amount in( select max(amount) from deposit);
(9) Give the name of cities where in which the maximum numbers of branches are l
ocated.
==> select b1.city from branch b1 group by b1.city having count(b1.bname)>ALL(se
lect count(b2.bname) from branch b2 where b1.city=b2.city group by b2.city);