✅✅MYSQL ||
\nSELECT id, CASE \n                when p_id is null then \'Root\' \n                when id IN (select distinct p_id from Tree) then \'Inner\'\n              
```\nSELECT id, CASE \n                when p_id is null then \'Root\' \n                when id IN (select distinct p_id from Tree) then \'Inner\'\n                else \'Leaf\'\n            end as \'type\'\nfrom Tree\norder by  id asc;\n```
[]