Given two table employee and department
EMP
----------------
empid deptid(fk)
Dept
---------------------
deptid(pk) deptname
que-Write a query to find count of employee in each
department.
Expected Output-
deptid countofEmployee
---------------------------
10 57
20 20
30 15
Answers were Sorted based on User's Feedback
Answer / anithaletchumi
select d.deptid,count(e.empid) as countofEmployee from
department d left outer join employee e on
d.deptid=e.deptid group by d.deptid
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / ajit
select d.deptno, count(e.deptno) total
from emp e, dept d
where e.deptno(+) = d.deptno
group by d.deptno;
Is This Answer Correct ? | 0 Yes | 0 No |
structural difference between bitmap and btree index ?
What is hot backup and logical backup?
What are internal user account in oracle?
How to Identify the previously inserted/updated records in already populated table.
various types of hints and their usage
Does a Before form trigger fire when the parameter form is suppressed ?
What is an Oracle Instance?
Query to retrieve record for a many to many relationship ?
How can we create the complete backup of data in the oracle.
0 Answers IPEC, Satyam, SunTec,
How to do paging with oracle?
What is where clause in oracle?
What is a Sequence ?