SQL doesn't have homoiconic structure like Prolog or Lisp, which would facilitate metaprogramming.
Prolog and Lisp were derived from first principles, SQL was designed to be a language that reads similar to English (i.e. easy to learn for non-programmers).
Prolog and Lisp also has the concept of "atom" which can represent many things, but in parsing it's used for terminal symbols.
Prolog has the advantage over Lisp that you can define custom operators and their precedence, so you can create easy to read domain specific languages without excessive amounts of parentheses.
The built-in backtracking can also be useful for parsing.
Definite Clause Grammer rules are also a standard feature, which is very similar to the Backus-Naur form.
Prolog and Lisp were derived from first principles, SQL was designed to be a language that reads similar to English (i.e. easy to learn for non-programmers).
Prolog and Lisp also has the concept of "atom" which can represent many things, but in parsing it's used for terminal symbols.
Prolog has the advantage over Lisp that you can define custom operators and their precedence, so you can create easy to read domain specific languages without excessive amounts of parentheses.
The built-in backtracking can also be useful for parsing.
Definite Clause Grammer rules are also a standard feature, which is very similar to the Backus-Naur form.
https://en.wikipedia.org/wiki/Definite_clause_grammar