Oracle | Case when | Easiest Solution
\nselect id, \ncase when p_id is null then \'Root\'\nwhen id in (select p_id from Tree) then \'Inner\'\nelse \'Leaf\'\nend type\nfrom tree;\n
```\nselect id, \ncase when p_id is null then \'Root\'\nwhen id in (select p_id from Tree) then \'Inner\'\nelse \'Leaf\'\nend type\nfrom tree;\n```
['Oracle']