Select case when P is Null then concat(N,\' Root\') end as root, case when N not in (select P from BST) then concat(N,\' Leaf\') end as leaves, case when N