Course contents
On this page
Lesson plan 13: Query front end
Trace SQL text through parsing, name binding, type checking, and logical-plan construction.
Placement: Part 3: Turning requests into execution.
Prerequisites: Lesson 12: Specialized access paths, plus the earlier dependency chain.
Learning outcomes
- Trace SQL text through parsing, name binding, type checking, and logical-plan construction.
- Explain catalog visibility, ambiguity, NULL behavior, and semantic error handling.
- Separate syntactic acceptance from executable meaning and optimization.
- Separate a general mechanism, a documented implementation choice, and an illustrative numerical assumption.
Teaching sequence
- Establish the motivating situation: An apparently valid query binds an unqualified name to the wrong relation after a schema change.
- Introduce the vocabulary and the correctness obligation before an optimization. Define parsing, binding, type checking.
- Develop the mechanism: Transform SQL into a typed plan while preserving names, types, parameters, privileges, and schema dependencies.
- Follow the complete worked example: A three-table query has 6 left-deep table permutations before considering physical operators. Explain the assumptions, intermediate units, and limiting interpretation.
- Extend the scenario to changed load, skew, or failure, explaining catalogs, SQL nulls, logical plans.
- Connect the mechanism to a documented implementation and an alternative with a different workload fit. Close by stating the remaining cost and the next lesson dependency.
Required chapter material
Use a complete execution trace or worked calculation, supported by an annotated static diagram or table. Include language-neutral pseudocode or labeled SQL when it clarifies the mechanism. State preconditions, ownership, visibility, and failure boundaries for algorithms. Describe operational costs as well as the normal path. All questions raised in the narrative must be resolved in the text.
Visual explanation
An annotated front-end pipeline transforms a query into a bound relational expression while preserving source locations for errors. The accompanying prose explains the arrows, state changes, or table entries so the lesson remains understandable in a plain Markdown reader.
Editorial checks
Confirm that the numerical example agrees with its units and assumptions. Check that a faster path preserves the stated contract, or explicitly identify the changed guarantee. Keep hypothetical figures separate from product measurements. Explain both an appropriate use and a limitation of the case design. Check terminology against the glossary and links against the course index.