Graphs in SQL
The terminology in graph theory pretty much explains itself; the concept of a bunch of lines connecting dots seems simple enough. But graph theory is surprisingly powerful and rich in mathematical complexity. You might want to read some of the books suggested in the last section of this chapter, if you never had a course in it before.
Graphs are important because they are a general way to represent many different types of data and their relationships. A few examples among many are:
• Social networks
• Friend of a friend
• Degree of separation
• Traffic routing
Here is a quick review of terms, though you will find other authors have different ones for the same concepts.
A graph is a data structure made up of nodes connected ...