MySQL Easy Solution
\n# Write your MySQL query statement below\nselect id,\ncase\n\twhen p_id is null then \'Root\'\n\twhen id in (select p_id from Tree) then \'Inner\'\n\telse \'L
```\n# Write your MySQL query statement below\nselect id,\ncase\n\twhen p_id is null then \'Root\'\n\twhen id in (select p_id from Tree) then \'Inner\'\n\telse \'Leaf\'\nend as type\nfrom Tree\norder by id;\n```\n# UPVOTE IF U FOUND IT USEFUL
['MySQL']