MySQL Solution
Code\n\n# Write your MySQL query statement below\nselect id, \ncase when p_id is null then \'Root\'\nwhen id in (select p_id from tree) then \'Inner\'\nelse \'L
# Code\n```\n# Write your MySQL query statement below\nselect id, \ncase when p_id is null then \'Root\'\nwhen id in (select p_id from tree) then \'Inner\'\nelse \'Leaf\' end as type\nfrom Tree;\n```
['MySQL']