Comparing SQL and Prolog

后端 未结 8 647
深忆病人
深忆病人 2021-01-29 18:34

I\'ve started learning Prolog and wondering about the theoretical difference from the SQL language.

For example:

  • both are declarative languages
  • b
8条回答
  •  不思量自难忘°
    2021-01-29 19:17

    Just a few thoughts:

    1. SQL is a query language for (maybe arbitrary complex) accessing to (relational) data, it's not a programming language.
    2. Even if treat SQL as programming language - it's not Turing complete. I can hardly imagine sql query returning sum of 1 to 100 (for example).
    3. SQL is language for accessing/manipulating (DML) to data bases, where Prolog is a language for working with knowledge bases (& rule resolution engine, of cause). Virtually Prolog is no more then simply unification & backtracking.
    4. This is not saying about the application domains of SQL & Prolog, which are of cause totally different - efficient (regular) data storage & AI/symbolic computations/parsing/expert systems/constraint solvers/.../much more.

提交回复
热议问题