Modeling a power grid

Hierarchical and Recursive Queries in SQL Server

Jasmin Ludolf

Content Developer

The power grid

The power grid

An example image of an electrical grid structure

Hierarchical and Recursive Queries in SQL Server

Modeling a power grid

You need three ID values:

  • ID of the power line: EquipmentID
  • ID of the first connected power line: EquipmentID_From
  • ID of the second connected power line: EquipmentID_To

Simplified representation how a power grid is modeled.

Hierarchical and Recursive Queries in SQL Server

Characteristics of power lines

  • Voltage Level
    HV - high Voltage, MV - medium voltage, LV - low voltage
    
  • Description
    Cable, Overhead Line, Transformer
    
  • Construction Year: Year of construction
  • Inspection Year: Year of the last inspection
  • Condition Assessment:
good,bad,repair,exchange
Hierarchical and Recursive Queries in SQL Server

Common task for grid maintenance

Find the power lines to be replaced

  • Find the power lines that are connected to each other: use recursion to find the connected power lines
  • Find power lines with bad, exchange or repair condition
+-----------------+---------------------------+
| Line            | Condition                 |
|-----------------|---------------------------|
| 1               | exchange                  |
|-----------------|---------------------------|
| 2               | repair                    |
|-----------------|---------------------------|
| 3               | bad                       |
+-----------------+---------------------------+

Power grid maintenance engineers on their daily work

Hierarchical and Recursive Queries in SQL Server

Let's find the power lines to be maintained!

Hierarchical and Recursive Queries in SQL Server

Preparing Video For Download...