Hierarchies should be trees and not loops.
Learn how SQL Assertions in Oracle AI Database 23.26.1 can help prevent cycles in hierarchical data.
https://www.salvis.com/blog/2026/02/23/enforcing-acyclic-hierarchies-with-sql-assertions/

Enforcing Acyclic Hierarchies With SQL Assertions
Introduction Referential integrity constraints have been available since version 7 of the Oracle Database. While these constraints ensure that referenced rows exist, they cannot express more complex integrity rules that span multiple rows or tables. Check constraints are similarly limited, as they can only validate conditions on the columns of a single […]