Comparing SQL and Prolog

后端 未结 8 657
深忆病人
深忆病人 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 18:54

    The main difference in my eyes is that SQL retrieves rows from tables - that is, from a finite set of instantiated objects corresponding to certaing filter conditions. On the other hand, Prolog gives you theoretically all the instantiable objects that satisfy the conditions. And while in Prolog you can also retrieve entities from a finite set, in SQL you can't fetch all the values from a theoretically infinite set.

提交回复
热议问题