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 would you go about verifying the network name that the local_listener is currently using?
How to enter a new row into a table interactively?
How to specify default values in insert statement using oracle?
How does oracle handle read consistency?
What is a relational database management system?
Explain the use of grant option in exp command.
Can the query output be sorted by multiple columns in oracle?
What is Trigger in Oracle?
Can group functions be used in the order by clause in oracle?
How to add a new column to an existing table with a default value?
How to commit the current transaction in oracle?
Does oracle charge for java?
Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.
How to Truncate Table in Oracle
How to use "in out" parameter properly?