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 |
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.
How to define an oracle sub procedure?
12 RULES OF RDBMS
How to display the hierarchy of employee and managers without using connect by prior.
after installatio of ORACLE 8i, work properly, but after restarting the system, it throw an error ORA 01034: ORACLE not availble
How many types of tables are there in oracle?
How to create a temporary table in oracle?
What are the various types of snapshots ?
What are the system predefined user roles?
How to use "startup" command to start default instance?
24. Display the order number for all orders whose average item cost is greater than the overall average item cost across all orders.
Explain about achiever in sql?