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 |
How can I introduce multiple conditions in like operator?
How to define a procedure inside another procedure?
when do u go for hash partitioning?
How to use windows user to connect to the server?
Anyone have the Latest Oracle Dumbs?While u have please forard to narain1411@gmail.com
What are the components of Logical database structure of ORACLE database?
What is max rowid in oracle?
How many anonymous blocks can be defined?
what is the dual table in oracle?
In Oracle Applications We are Using Sub Ledger Accounting. When we Transfer the Data all modules (AP,AR,CE,FA) to SLA We done Some customizations? What are They??
what are corelated subqueries
Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.