back

by david927·17y ago·view on hn ↗
no SQL query will give you the path in a graph

Could you explain what you mean there? Do you mean the path of how a graph was traversed?

3 comments
Consider a graph, e.g. the facebook friend graph. You can't write a SQL query which will determine if I'm connected to Kevin Bacon and via which friend.

SQL expresses first order set theory, but graph connectivity is not a first order property.

Perfect. Thanks.
I guess some sort of hierarchical queries are meant here.

I.e. TREE_NODE table containing ID and PARENT_ID. You cannot query all parents of a given node using simple SQL.

A family tree can be stored in an SQL database, but you cannot query them easily - e.g. Who is the first common ancestor between these two individuals?