| ID | Name | ChildName | YearBirth | Gender | FatherID | foodName | FatherID |
|----|------|-----------|-----------|--------|----------|-----------|----------|
| 1 | Paul | Paul Jr | 2010 | Boy | 1 | Chocolate | 1 |
| 1 | Paul | Paul Jr | 2010 | Boy | 1 | Bannana | 1 |
| 2 | John | John Jr | 2011 | Boy | 2 | Pineapple | 2 |
| 2 | John | John Jr | 2011 | Boy | 2 | Raspberry | 2 |
| 2 | John | John Jr | 2011 | Boy | 2 | Lemon | 2 |
| 2 | John | Cindy | 2009 | Girl | 2 | Pineapple | 2 |
| 2 | John | Cindy | 2009 | Girl | 2 | Raspberry | 2 |
| 2 | John | Cindy | 2009 | Girl | 2 | Lemon | 2 |
select f.name, c.name, c.birthyear, c.genre, null
from father f
inner join children c on f.id = c.fatherid
union all
select father.name, null, null, null, food.name
from father
inner join food on father.id = food.fatherid
order by 1, 2, 3
Open in new window