MySQL Clean Solution || With Detail Explanation
Intuition\n Describe your first thoughts on how to solve this problem. \n\n\n# Code\n\n# Write your MySQL query statement below\nSELECT id, \n    CASE\n        
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n![img.png](https://assets.leetcode.com/users/images/1acc8c92-4889-4c3f-a055-ec6731c171bf_1715012707.9357057.png)\n\n# Code\n```\n# Write your MySQL query statement below\nSELECT id, \n    CASE\n        WHEN p_id IS NULL THEN \'Root\'\n        WHEN id IN (\n            SELECT p_id FROM Tree\n        ) THEN \'Inner\'\n        ELSE \'Leaf\' END AS type\nFROM Tree\n```
['Database', 'MySQL']