Given a table Tree containing node ids and their parent ids (p_id), write a query to label each node as one of the following:
| id(INTEGER) | p_id(INTEGER) |
|---|---|
| 1 | null |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 2 |
| id(INTEGER) | node_value(VARCHAR) |
|---|---|
| 1 | Start |
| audit_id(INTEGER) | id(INTEGER) | change_date(DATE) |
|---|---|---|
| 501 | 1 | 2026-02-09 |
| id(INTEGER) | type(VARCHAR) |
|---|---|
| 1 | Root |
| 2 | Inner |
| 3 | Leaf |
| 4 | Leaf |
| 5 | Leaf |