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
With your `select:
select ename, salgrade.grade, dept.dname from emp, salgrade, dept
WHERE emp.sal BETWEEN salgrade.losal AND salgrade.hisal
AND emp.deptno = dept.deptno group by salgrade.grade, dept.dname, emp.ename
when you group by salgrade.grade, dept.dname, emp.ename
the results will be grouped into those three values. You also put the results BETWEEN salgrade.losal AND salgrade.hisal
so it will give all employees
that have the salary in that interval. It's not restricting anything to the greater one got it? And that's why you have WARD 2 SALES
and MARTIN 2 SALES
.