[MySql] || EASY || Beginner Friendly
Write your MySQL query statement below\n\nSELECT id , CASE WHEN p_id IS NULL THEN "Root"\nWHEN id NOT IN (select DISTINCT p_id from Tree WHERE p_id IS NOT NULL)
# Write your MySQL query statement below\n```\nSELECT id , CASE WHEN p_id IS NULL THEN "Root"\nWHEN id NOT IN (select DISTINCT p_id from Tree WHERE p_id IS NOT NULL) THEN "Leaf"\nELSE "Inner" END AS type \nFROM Tree\nORDER BY p_id;\n```
['Union Find', 'MySQL']