What is the best way to represent a many-to-many relationship between records in a single SQL table?
I have a SQL table like so: Update: I'm changing the example table as the existing hierarchical nature of the original data (State, Cities, Schools) is overshadowing the fact that a simple relationship is needed between the items. entities id name 1 Apple 2 Orange 3 Banana 4 Carrot 5 Mushroom I want to define two-way relationships between these entities so a user viewing one entity can see a list of all related entities. The relationships are defined by an end user. What is the best way to represent these relationships in the database and subsequently query and update them? One way as I see it