I am new to coding. Now I have a employee table looked like below:
| Name | Hometown | School |
|---|---|---|
| Jeff | Illinois | Loyola University Chicago |
| Alice | California | New York University |
| William | Michigan | University of Illinois at Chicago |
| Fiona | California | Loyola University Chicago |
| Charles | Michigan | New York University |
| Linda | Indiana | Loyola University Chicago |
I am trying to get those employees in pairs where two employees come from different state and different university. Each person can only be in one pair. The expected table should look like
| employee1 | employee2 |
|---|---|
| Jeff | Alice |
| William | Fiona |
| Charles | Linda |
The real table is over 3,000 rows. I am trying to do it with SQL or Python, but I don't know where to start.