top of page
Home: Blog2
Writer's pictureAnuj Yadav

Solution of SQL section

Question no 3.






select deptname,maxempcount from department;

Question no.4






select  a.allocid,d.deptid,e.empid from allocation a join department  d on d.deptid=a.did  join employee e on e.empid=a.eid where d.deptid=100 or d.deptid=200;

Question no.5






select d.deptid,count(distinct e.empid) from employee e natural join department d natural join allocation a group by d.deptid;

Qusetion no.6






select  d.deptname from allocation a join department  d on d.deptid=a.did  join employee e on e.empid=a.eid group by d.deptname having count(a.eid)>5;

Question no.7






select  a.allocid,e.empid,e.empname from allocation a join department  d on d.deptid=a.did  join employee e on e.empid=a.eid where d.deptname='Finance';

17 views0 comments

Recent Posts

See All

Comments


Home: Subscribe

CONTACT

 Kanpur, India

8299229032

  • twitter

Thanks for submitting!

Home: Contact
bottom of page