Oracle SQL sample database

前端 未结 6 1792
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-11 08:45

I\'m trying to learn Oracle SQL by database Supplied by it. I found somewhere tasks to be done. Database structure is supplied by Oracle:

CREATE TABLE EMP
(EMPNO         


        
6条回答
  •  孤街浪徒
    2021-02-11 09:14

    Screen Shot ////// Try this out

    SELECT E.EMPNO, E.ENAME, E.JOB, D.DNAME, E.SAL, E.DEPTNO, S.GRADE 
    FROM EMP E, SALGRADE S, DEPT D 
    WHERE E.SAL IN (SELECT MAX(SAL) FROM EMP GROUP BY DEPTNO) 
    AND E.SAL BETWEEN S.LOSAL AND S.HISAL 
    AND E.DEPTNO = D.DEPTNO
    ORDER BY E.SAL DESC
    

提交回复
热议问题