How to implement Nested set model in SQL: