Another Database Design Mistake to Avoid
Recursive programming is used in a few places in computer science. Most notably in stack processing. The big picture looks something like:
x program starts (a)
which calls itself again (b)
which calls itself again (c )
then iteration c finishes
iteration b finishes
iteration a finishes
Recursive relationships are also sometimes used in database design.
The classic example is an organization that has employees. And managers. The managers are also employees.
Unfortunately, I’ve seen the recursion pulled out into another table! A lookup table.
I’m convinced that the lookup table was created because someone learned how to normalize into first normal form. And they came to believe that 1NF and making lookup tables is everything you need to know about database design. However, database design is actually a pretty deep subject, and 1NF is just a start.
Define recursive relationships in a single table.