SQL Assignment#4 - 8. Select e.deptno department, e.ename...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
David Carothers CS-220 11/5/07 Assignment #8 SQL Assignment #4 1. select emp.ename, emp.deptno, dept.deptno from emp, dept 2. select job from emp where deptno LIKE 30 3. Select e.ename , d.dname, d.loc from emp e, dept d where e.deptno = d.deptno and e.comm is not null; 4. select e.ename, d.dname from emp e, dept d where e.ename like '%A%' 5. select e.ename, e.job, e.deptno, d.dname from emp e, dept d where d.loc like 'DALLAS' 6. select worker.ename "Employee", worker.empno "Emp#", manager.ename "Manager", manager.mgr "Mgr#" from emp worker, emp manager where worker.mgr = manager.empno 7. select worker.ename "Employee", worker.empno "Emp#", manager.ename "Manager", manager.mgr "Mgr#" from emp worker, emp manager where worker.mgr = manager.empno OR worker.mgr IS NULL
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 8. Select e.deptno department, e.ename employee, c.ename colleague from emp e, emp c where e.deptno = c.deptno and e.empno <> c.empno order by e.deptno, e.ename, c.ename; 9. a. select * from salgrade; b. select e.ename, e.job, d.dname, e.sal, s.grade from emp e, dept d, salgrade s 10. select ename, hiredate from emp where months_between(sysdate, hiredate) < months_between(sysdate, '01-MAY-81') 11. Select e.ename Employee , e.hiredate Emp Hiredate , m.ename Manager, m.hiredate Mgr Hiredate from emp e, emp m where e.mgr = m.empno and e.hiredate < m.hiredate; 12. Select rpad(ename, 8) ||rpad(*, sal/100, *) Employee_and_their_salaries from emp order by sal desc;...
View Full Document

This note was uploaded on 02/21/2012 for the course COMPUTER CS 220 taught by Professor Idk during the Fall '07 term at Capitol College.

Ask a homework question - tutors are online