Oracle SQL sample database

前端 未结 6 1796
爱一瞬间的悲伤
爱一瞬间的悲伤 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:26

    SELECT  SUB2.ENAME , SUB2.DNAME , S.GRADE  ,SUB2.SAL  
    FROM SALGRADE S,
    (SELECT E.ENAME,E.SAL,D.DNAME
        FROM EMP E, DEPT D,  
            (SELECT DEPTNO, MAX(SAL) AS "MAX"
                FROM EMP
                GROUP BY DEPTNO) SUB1  
        WHERE E.SAL=SUB1.MAX
        AND E.DEPTNO=D.DEPTNO) SUB2
    
    WHERE SUB2.SAL BETWEEN S.LOSAL AND S.HISAL
    

提交回复
热议问题