This visual execution shows how the PostgreSQL functions LAG and LEAD work to compare rows. Starting with rows ordered by id, LAG fetches the previous row's value, and LEAD fetches the next row's value. For the first row, LAG returns NULL because there is no previous row. For the last row, LEAD returns NULL because there is no next row. The ORDER BY clause inside the OVER() defines the sequence for these functions. The execution table traces each row's current value, previous value via LAG, and next value via LEAD. Variable tracking shows how these values change step-by-step. Key moments clarify common confusions about NULL results and ordering. The quiz tests understanding of these concepts by referencing the execution table and variable tracker.