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 / 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 |
Post New Answer View All Answers
What is PL/SQL ?
How to define a specific record type?
What are data pump export and import modes?
How a tablespace is related to data files?
Is oracle a relational database?
Please explain compound trigger in oracle?
defination of bitmap index
What is key preserved table?
what are the default admin accounts in Oracle 10g ?
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.
what is the difference between data migration and production migration.
You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
How to start a specific oracle instance?
How to do clean up if create database failed?
How to use attributes of the implicit cursor in oracle?