Oracle logoOracle
CodingMembers

SQL — Classify Tree Nodes as Root, Inner, or Leaf

Members only

Given a `Tree` table with `id` and `pid` (parent id), write one SQL query that labels every node as `Root` (no parent), `Inner` (has a parent and at least one child), or `Leaf` (has a parent and no ch...

Infra Eng
sql
tree
easy
Frequency
Single report
Last asked
2026-09-10
Stage
tech-screen

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...