SQL是哪种语言? [英] What kind of language is SQL?
本文介绍了SQL是哪种语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SQL是上下文无关语言还是某种其他类型的语言?
Is SQL a context free language or some other type of language?
推荐答案
根据 https://stackoverflow.com/a/31265136 SQL不是常规语言.简短的解释是每个选择查询看起来像
According to https://stackoverflow.com/a/31265136 SQL is not a regular language. The short explanation is that each select query looks like
SELECT x FROM y WHERE z
和y
本身可以是另一个选择查询,因此无法使用有限状态机进行模拟.如前所述, Backus–Naur表单,因此SQL是非常规上下文免费语言.
and y
can be another select query itself, so it cannot be simulated with finite-state machine. As mentioned before, there are some CFGs for SQL standarts in Backus–Naur Form, thereby SQL is nonregular context free language.
这篇关于SQL是哪种语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文