I am learning SQL, and I'm working with virtual tables, and self-joins, the table (name: SALESREPS) I'm working on is in the image.
The objective for the query is to find the employees with higher quota than their manager, but I'm having troubles to understand why, for this query
SELECT EMPL.NAME, EMPL.`QUOTA`, MNG.`QUOTA`
FROM `SALESREPS` EMPL, `SALESREPS` MNG
WHERE MNG.`EMPL_NUM` = EMPL.`MANAGER`
AND EMPL.`QUOTA` > MNG.`QUOTA`;
the output is:
+-------------+-----------+-----------+
| NAME | QUOTA | QUOTA |
+-------------+-----------+-----------+
| Mary Jones | 300000.00 | 275000.00 |
| Larry Fitch | 350000.00 | 275000.00 |
| Bill Adams | 350000.00 | 200000.00 |
| Dan Roberts | 300000.00 | 200000.00 |
| Paul Cruz | 275000.00 | 200000.00 |
+-------------+-----------+-----------+
Which is correct, that is what i want. But if i change the WHERE clause to
SELECT EMPL.NAME, EMPL.`QUOTA`, MNG.`QUOTA`
FROM `SALESREPS` MNG, `SALESREPS` EMPL
WHERE MNG.`MANAGER` = EMPL.`EMPL_NUM`
AND EMPL.`QUOTA` > MNG.`QUOTA`;
the output is:
+-------------+-----------+-----------+
| NAME | QUOTA | QUOTA |
+-------------+-----------+-----------+
| Sam Clarck | 275000.00 | 200000.00 |
| Larry Fitch | 350000.00 | 300000.00 |
+-------------+-----------+-----------+
Which is incorrect. And i can't understand why that happen. I'm just swapping the column I'm referencing in each virtual table (EMPL and MNG). I changed from
WHERE MNG.EMPL_NUM = EMPL.MANAGER
to
WHERE MNG.MANAGER = EMPL.EMPL_NUM
but the equality should yield the same result, however, it doesn't happen that way.

Given both examples include this same predicate expression:
This:
is NOT the same as this:
Because it inverts the roles relative to which must now be greater than the other.
While I'm here, NEVER combine tables using this syntax:
This has been obsolete since the release of the ANSI-92 standard more than 30 years ago. If you're learning from material that teaches it this way, you should ditch that material. It's not leading you in a good direction.
The correct way to write the query is like this: