Graph Database style explorations of relational database with Formula One data- Oracle Database 23c Property Graph

Lucas Jellema
6 min readApr 19, 2023

The core Formula One data could be represented in a graph like this:

Graph for Formula One — Driver participate in Races on Circuits

Drivers compete in races that are hosted on circuits. A result is achieved by the driver (position and points for the championship).

If this is the graph, some questions can easily be answered:

With whom has a specific driver (say Max Verstappen) shared the podium?

MATCH (a IS driver where a.name = ‘Max Verstappen’) -[b IS result where b.position <= 3]-> (c IS race) <-[d is result where d.position <= 3]- (e IS driver)
WHERE NOT VERTEX_EQUAL(a,e)

Which drivers from the same country have shared the podium?

MATCH (a IS driver ) -[b IS result where b.position <= 3]-> (c IS race) <-[d is result where d.position <= 3]- (e IS driver)
WHERE NOT VERTEX_EQUAL(a,e) and a.nationality = e.nationality

Lucky day: who won two or more races on the same day in the year (different years obviously)?

MATCH (a IS driver ) -[b IS result where b.position = 1]-> (c IS race)
, (a IS driver ) -[d IS result where d.position = 1]-> (e IS race)
WHERE NOT VERTEX_EQUAL(c,e) and to_char(c.race_date,’DDMM’) = to_char(e.race_date,’DDMM’)

--

--

Lucas Jellema
Lucas Jellema

Written by Lucas Jellema

Lucas Jellema is CTO and IT architect at Conclusion, The Netherlands. He is Oracle ACE Director, one time JavaOne Rockstar and programmer

No responses yet