I encountered the following statement when reading about the constituents of a query processor in a DBMS:
... (b) A query preprocessor, which performs semantic checks on the query (e.g., making sure all relations mentioned by the query actually exist), ...
Page 10, 1.2.5 The Query Processor, Database Systems: The Complete Book (2nd Edition) by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom.
I have experience with computer science, but I have only just started studying DBMS and database design, so I am unsure if I am interpreting this statement incorrectly.
My understanding of semantic and syntactic errors in programming are as follows:
1) Syntax errors. These are invalid code the compiler doesn't understand. The compiler will detect them, because it can't compile them.
2) Semantic errors. These are valid code the compiler understands, but they do not do what you, the programmer, intended. There is no way for the compiler to detect them.
Since the compiler (query compiler) cannot detect semantic errors, is the aforementioned statement incorrect? Should it instead say that the query preprocessor performs syntactic checks on the query?
I would greatly appreciate it if people could please take the time to clarify this.