not an expert, but try to learn
one table, with column as ID int not null; and parent ID int ;
if a row has parent ID not null, then go find it's parent; otherwise it's a root node.