select p.name, nc.name, sc.name from person p, clothe nc, clothe sc wher
e p.normal_clothe_id = nc.id and p.sunday_clothe_id = sc.id order by p.name;
Here result:
+------+-----------+-----------+
| name | name | name |
+------+-----------+-----------+
| p1 | clothe #1 | clothe #2 |
| p2 | clothe #1 | clothe #1 |
| p3 | clothe #2 | clothe #3 |
| p4 | clothe #1 | clothe #3 |
| p5 | clothe #3 | clothe #1 |
| p6 | clothe #1 | clothe #3 |
+------+-----------+-----------+
here what is in Person table:
+------+-----------+-----------+
| name | name | name |
+------+-----------+-----------+
| p1 | clothe #1 | clothe #2 |
| p2 | clothe #1 | clothe #1 |
| p3 | clothe #2 | clothe #3 |
| p4 | clothe #1 | clothe #3 |
| p5 | clothe #3 | clothe #1 |
| p6 | clothe #1 | clothe #3 |
+------+-----------+-----------+
here what is in Clothe:
+----+-----------+
| id | name |
+----+-----------+
| 1 | clothe #1 |
| 2 | clothe #2 |
| 3 | clothe #3 |
+----+-----------+
Next time do your homework yourself 🙂))
For father mother is kinda same stuf.