The need to store hierarchies in SQL is pretty common. Organisational unit databases, staff or position reporting lines, group membership information, … the list goes on.
Dealing with them directly in SQL is far less common. Mostly because these schemas generally define some sort of graph (usually a tree), and SQL returns flat results (tuples, or less formally rows).
This post isn’t meant to cover this complex topic, as there’s already far better places to go for that*. Instead, I want to cover an interesting “solution” to the problem of getting MySQL to return all the nodes in a tree (represented by a [ID, …, ParentID] schema) that sit somewhere under a given parent node, recursively.