Beats 99% | Clean Solution 🎯
Code


# Code
```mysql []
# Write your MySQL query statement below
SELECT
id,
CASE
    WHEN p_id IS NULL THEN 'Root'
    WHEN id IN (SELECT p_id FROM Tree) THEN 'Inner'
    ELSE 'Leaf'
END AS type
FROM Tree


```
['MySQL']