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
Answer Posted / 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 |
Post New Answer View All Answers
How to view the tablespaces in the current database?
What are the advantages of oracle?
Explain alias?
What is Reduced List of Values?
How to load data from external tables to regular tables?
Can we use bind variables in oracle stored procedure?
Using the relations and the rules set out in the notes under each relation, write statements to create the two sequence generators specified in the notes.
What are joins, explain all types of joins?
 What are the oracle DML commands possible through an update strategy?
Use of an integrity constraint is better to validate data. Explain
What is redo log?
Can the query output be sorted by multiple columns in oracle?
What are the data types in oracle?
What do you mean by group by clause?
How to display employee records who gets more salary than the average salary in the department?