##Verse 1
Knife goes slice,
Fork goes stab,
Spoon goes scoop,
Chopsticks go grab.
Cup goes swish,
| -- https://www.hackerrank.com/challenges/binary-search-tree-1 | |
| select node, type from ( | |
| (select N as node, "Root" as type from BST where P is null) | |
| union | |
| (select t1.N as node, "Leaf" as type from BST t1 | |
| left join BST t2 on t1.N = t2.P | |
| where t2.P is null) | |
| union | |
| (select distinct t1.N as node, "Inner" as type from BST t1 |