All Questions
Postgresql medium

Which SQL feature should be used to efficiently traverse a self-referencing relationship, such as an organizational chart or file directory system?

  1. A LATERAL JOIN: Allows a join to reference columns from previously matched tables in the plan.
  2. B WITH RECURSIVE: A Common Table Expression (CTE) that iteratively calls its own result set.
  3. C WINDOW FUNCTION: Performs a calculation across a set of table rows related to the current row.
  4. D PARTITION BY: Groups the result set into distinct sub-sets for aggregate-level calculations.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions