I'm unsure how this query works regarding the from EMPLOYEE A and EMPLOYEE B. I know distinct removes duplicated values, but why are there two tables if you are only selecting A.EMPLOYEE_ID, A.LAST_NAME, A.TITLE, doesn't B.EMPLOYEE_ID, B.LAST_NAME, B.TITLE need to be included in the SELECT part too? How does it work? Also I know that <> means not equal to.
SELECT DISTINCT A.EMPLOYEE_ID, A.LAST_NAME, A.TITLE
FROM EMPLOYEE A, EMPLOYEE B
WHERE A.EMPLOYEE_ID <> B.EMPLOYEE_ID
AND A.TITLE <> B.TITLE
AND B.LAST_NAME = A.LAST_NAME