Skip to Main Content

Write Great SQL Office Hours

Free tips and training every month! Subscribe for reminders and more from Office Hours.

Header container

July 16, 2019

Advanced SQL - Graph Traversal Problems with Spatial and Graph solutions
SQL is a powerful language. But there are still some queries it struggles with!

In this session we investigate some thorny problems:

Find all the fully connected subgraphs in a graph
Find the average (mean) of a node's children in a tree

Key highlights include:

01:15 - Finding all the fully connected subgraphs in a graph; introduce the problem
07:00 - Walk through Live SQL solutions to this problem
20:30 - Performance considerations for this: are graph technologies better suited?
22:20 - Introduction to Oracle Spatial & Graph
25:10 - Spatial & Graph architecture
30:20 - Solutions could be slow; reframe the problem - perhaps looking for strongly connected components instead?
41:30 - Find the hierarchical mean; introduce the problem
45:30 - Walk through Live SQL solutions to this problem
50:35 - Introduce PGQL (property graph query language) & sketch solutions with this
55:10 - Further graph resources

Live SQL scripts with setup & solutions:

Fully Connected Subgraphs https://livesql.oracle.com/apex/livesql/file/content_IOHVI2K4AYK6GOMOAVG93YBF6.h tml

Hierarchical Mean https://livesql.oracle.com/apex/livesql/file/content_IOHVI2K5THQ213SZ6XOZPB402.h tml

Subscribe to give us feedback and be notified of upcoming sessions!

Ask a Question

Ask The Experts - Right Now!

Do you have a question about SQL you'd like our experts to answer in their next session? Sign in and submit it here.

Please note that we cannot guarantee to answer all questions. We cannot help you with open Service Requests or account/licensing issues.

Experts

Your Experts
Chris Saxon
Chris Saxon, Oracle Developer Advocate for SQL    
Chris Saxon is the quizmaster for the Database Design competitions and an Oracle Developer Advocate for SQL. His job is to help you get the best out of the Oracle Database and have fun with SQL! He's also part of the answer team on Ask TOM and creates YouTube videos at The Magic of SQL channel.
Hans Viehmann
Hans Viehmann,