| Database Question Bank - Part 1 – 043 |
Question
How to display ename, dname even if there no employees working in a
particular department(use outer join). (Oracle DB) (SQL)
Answer
Select ename, dname from emp e, dept d where e.deptno (+)=
d.deptno;
Question How to display employee name and his manager name. (Oracle DB) (SQL)
Answer Select e.ename, m.ename from emp e, emp m where e.mgr=m.empno;
Question
How to display the department name along with total salary in each
department. (Oracle DB) (SQL)
Answer Select deptno, sum(sal) from emp group by deptno;
Question How to display the department name and total number of employees in
each department. (Oracle DB) (SQL)
Answer select deptno,count(*) from emp group by deptno;
Question How to display the current date and time (Oracle DB) (SQL)
Answer select to_char(sysdate,'month mon dd yy yyyy hh:mi:ss') from dual;
How to display ename, dname even if there no employees working in a
particular department(use outer join). (Oracle DB) (SQL)
Answer
Select ename, dname from emp e, dept d where e.deptno (+)=
d.deptno;
Question How to display employee name and his manager name. (Oracle DB) (SQL)
Answer Select e.ename, m.ename from emp e, emp m where e.mgr=m.empno;
Question
How to display the department name along with total salary in each
department. (Oracle DB) (SQL)
Answer Select deptno, sum(sal) from emp group by deptno;
Question How to display the department name and total number of employees in
each department. (Oracle DB) (SQL)
Answer select deptno,count(*) from emp group by deptno;
Question How to display the current date and time (Oracle DB) (SQL)
Answer select to_char(sysdate,'month mon dd yy yyyy hh:mi:ss') from dual;
Post Your FREE Resume Today to attract top employers!


