By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
dog_id | name | father_id | mother_id | level | relation |
---|---|---|---|---|---|
7 | GrandSon | 5 | 6 | 0 | |
5 | Son | 1 | 2 | 1 | father |
6 | Daughter | 3 | 4 | 1 | mother |
1 | Father | null | null | 2 | father |
3 | Father1 | null | null | 2 | father |
2 | Mother | null | null | 2 | mother |
4 | Mother2 | null | null | 2 | mother |