Oracle SQL sample database

前端 未结 6 2119
离开以前
离开以前 2021-02-11 08:59

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:08

    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
    

提交回复
热议问题