The Query Compiler Varun Sud ID: 104
Agenda Parsing Syntax analysis and Parse Trees. Grammar for a simple subset of SQL Base Syntactic Categories The Preprocessor.
Parsing Three steps of query processor Parse SQL query into parse tree. Transform parse tree into expression tree. Transform logical query plan into physical query plan.
Syntax analysis and parse trees Parser converts SQL text to parse tree Nodes of trees correspond to: Atoms: lexical elements such as keywords, names of attributes or relations etc Syntactic categories, which are names of families of query subparts.
Grammar for simple subset of SQL Queries ::= ::= ( ) SFW: select from were ::= means “can be expressed as.”
Contd. Select-From-Where Forms ::= SELECT FROM WHERE Select-Lists ::=, ::=
Contd. Conditions ::= AND ::= IN ::= = ::= LIKE ::=
The Preprocessor Preprocessor is responsible for semantic checking. Preprocessor must: Check relation uses. Check and resolve attribute uses Check types.
Thank You