From the course: SQL Server 2017: What's New

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Querying graph data

Querying graph data - SQL Server Tutorial

From the course: SQL Server 2017: What's New

Start my 1-month free trial

Querying graph data

- [Instructor] In the previous movie, we created a database with a node table for people and an edge table to store family relationship details. Now let's use those tables and take a look at how you would query information back out of the graph data base. First for this query, let's go ahead and pull the relationships out that we have saved so far. If I just run select star from family connections from the graph test data base, we'll get the results down below. Here we can see the from ID and the to ID for each relationship. We can see the relationship type over here on the far right side. In this case, we have one person that's the father, and one person that's a daughter. To get more detailed information from our graph, we can pull out the related details from the node table. In this case, the person's actual name would be more informative rather than just references to their node IDs. To do that, we begin with a basic select statement. Now because our graph connects a person in the…

Contents