1

Given the tables "users" and "nodes" (which will contain an adjacency list tree) what is the best way to link these tables (each user has a tree).

Putting the column "user_id" in the "nodes" table seems very ineffective to me, but I couldn't find other solution.

  • 1
    Each tree belongs to exactly one user? If yes, you can add a joining table with 2 columns: (root_node_id, user_id). The primary key will be (root_node_id) and (user_id) will be a foreign key to users. – ypercubeᵀᴹ Feb 25 '16 at 19:58

0 Answers0