A Game Of Hierarchies: Advanced Graph Algorithms In T-SQL