Advertisement
Guest User

sql 3

a guest
Oct 25th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. /*SELECT MIN(sal+NVL(comm,0)) "minimalna pensja", MAX(sal+NVL(comm,0)) "maksymalna pensja"
  2. FROM emp, dept
  3. where emp.deptno=dept.deptno and dname = 'RESEARCH'; */
  4.  
  5. /*select count(*)
  6. from emp,salgrade
  7. where emp.sal between losal and hisal and grade=1 */
  8.  
  9. /*select count(*), sum(comm)
  10. from emp,dept
  11. where emp.deptno=dept.deptno and comm is not null */
  12.  
  13. /*select min(sal) minimalna, max(sal) maksymalna, dname departament
  14. from emp E, dept D
  15. where E.deptno = D.deptno
  16. group by D.deptno, dname */
  17.  
  18. /*select count(*), dname departament
  19. from emp E, dept D
  20. where E.deptno=D.deptno and comm is null
  21. group by D.deptno, dname */
  22.  
  23. /*select count(*), job stanowisko
  24. from emp
  25. group by job*/
  26.  
  27. /*select count(distinct(job)), dname
  28. from emp, dept
  29. where emp.deptno=dept.deptno
  30. group by dname, dept.deptno*/
  31.  
  32. /*select max(sal)-min(sal) roznica, job
  33. from emp
  34. group by job
  35. having max(sal)-min(sal)>100*/
  36.  
  37. /*select sum(sal) suma, dname departament
  38. from emp, dept
  39. where emp.deptno=dept.deptno
  40. group by dept.deptno, dname
  41. having sum(sal)>9000*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement