1

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.

  • At this point, I think I may be correct in the sense that this is an error from the authors: "Query preprocessing can be a useful tool if you make sure to create valid syntax for your engine." ideaeng.com/query-pre-processing-0104 "Query preprocessing prepares the query for optimization. It may change the representation of a statement such that the SQL statement Component Integration Services generates is syntactically different from the original statement." infocenter.sybase.com/help/index.jsp?topic=/… – The Pointer Sep 1 '17 at 18:55
  • I have seen no evidence that indicates that the query preprocessor deals with semantics. – The Pointer Sep 1 '17 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.