Prolog is declarative, but it's very different to SQL and it's a shame to put the two together. It is much more interesting to examine Prolog from the logic programming point of view.<p>Also:<p>1) The sorting example is O(n!) not because of limitations of the language, as the article suggests, but because the algorithm implemented is <i>permutation sort</i>, which is O(n!).<p>A typical sorting algorithm example in Prolog is merge sort which is as efficient in Prolog as merge sort can be. Here are a few sorting algorithms in Prolog, including merge sort and quick sort:<p><a href="http://kti.ms.mff.cuni.cz/~bartak/prolog/sorting.html" rel="nofollow">http://kti.ms.mff.cuni.cz/~bartak/prolog/sorting.html</a><p>2) The Sudoku example uses a Constraint Logic Programming library implemented in Prolog (from the looks of it, Gnu Prolog). CLP is a different paradigm than plain logic programming, where one programs by specifying constraints.<p>A Sudoku solver in actual Prolog can be found in "99 Prolog Problems":<p><a href="https://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/prolog/problemas/" rel="nofollow">https://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/pro...</a><p>The sudoku solver is number 97.