O'Reilly logo

Joe Celko's SQL for Smarties, 4th Edition by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

37

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required