Database

How to Represent and Query Hierarchical Data in SQL

A tutorial on how to build and query a hierarchical table using a relational database.

Angelica Lo Duca
6 min readNov 29, 2021

--

Photo by benjamin lehman on Unsplash

Given its flat nature, a relational database is not suitable to represent hierarchical data. However, thanks to some tricks, you can transform a relational database into good storage for…

--

--

Angelica Lo Duca

Researcher | +50k monthly views | I write on Data Science, Python, Tutorials, and, occasionally, Web Applications | Book Author of Comet for Data Science