Table 1 Employee table
Table 2 Dept table
I wanted to filter employees who are working in LOC dallas and chicago
I know the correct query should be like below , we should use brackets (LOC = 'DALLAS' OR LOC = 'CHICAGO')
SELECT *
FROM EMP E, DEPT D
WHERE E.DEPTNO = D.DEPTNO
AND (LOC = 'DALLAS' OR LOC = 'CHICAGO')
Here 11 rows were coming in output
But , i just wanted to see what would happen if we don't put brackets like below
SELECT *
FROM EMP E, DEPT D
WHERE E.DEPTNO = D.DEPTNO
AND LOC = 'DALLAS' OR LOC = 'CHICAGO'
Here 19 rows were coming in output
I want to understand basically how this query is getting executed.