Using exists in a query instead of a regular where I saw this query that finds all the employees with more than one degree:

select id, name
from employee E
where exists (
 select *
 from academics A1, academics A2
 where  A1.emp_id = E.id and
        A2.emp_id = E.id and
        A1.discipline != A2.discipline
 )


But why is the exists necessary? Why not just do:

select id, name
from employee E, academics A1, academics A2
where A1.emp_id = E.id and
      A2.emp_id = E.id and
      A1.discipline != A2.discipline


Are the two above equivalent?
I'd suggest you another approach.

COUNT DISTINCT disciplines by employee.

Then use EXISTS to check if one Employee has more than one degree.

select      e.id, e.name
from        Employees e
where exists (select    1
              from      Academics a
              where     a.emp_id = e.id
              having count(distinct a.discipline) &gt; 1);


Or JOIN it with table Employees and show these were NumDegrees > 1

select      e.id, e.name, nd.NumDegrees
from        Employees e
inner join (select    emp_id, count(distinct a.discipline) NumDegrees
            from      Academics a
            group by  a.emp_id) nd
on          e.id = nd.emp_id
where       nd.NumDegrees &gt; 1;