Abstract

It is possible to model a general graph in SQL, but it is not practical. The advantage of SQL is that it is a declarative, set-oriented language. The nature of a relational database is the assumption that the relationships are known in advance, so that a schema can be built and loaded with known facts. This is a good assumption in a production environment. Actually, it is a necessary assumption. The most common way to model a graph in SQL is an adjacency list model. It is also the best way to model a general graph. Some special kinds of graphs can be modeled differently. It is a typical adjacency list model of a general graph with one kind of edge. Structure goes in one table, and the nodes go in a separate table, because they are separate kinds of things (entities and relationships).

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call