Retool Interview Question

Some variant of SQL execution. Data structure design.