Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Most of the (earlier) answers here are a reflection of the fact that most people do not know what SQL is (its an implementation of Relational Calculus) or what that means (that it's a form of Predicate Logic). The following statements are true of both Prolog and SQL:</p> <ul> <li>they are both logic-driven</li> <li>they can both store, express and use relations (logical relationships in Prolog)</li> <li>they can both store and express complex logical conditions</li> <li>they both have facts(data in SQL) and can derive conclusions from those facts</li> <li>they both have queries, that do in fact mean the same thing</li> <li>they both have data(facts in Prolog) and use them similarly</li> <li>they are both programming languages</li> <li>they are both turing-complete (though it is somewhat difficult to access this in both of them)</li> <li>etc, etc..</li> </ul> <p>Generally, people are not aware of these equivalences between them:</p> <ol> <li>"Facts" and "Data" are the same thing. This is straight out of Codd's original paper.</li> <li>A "Relation" in Relational Theory is the same thing as a "Table" in SQL, is the same thing as a Relation or relational function in Predicate Logic and is the same thing as a tuple-set in Set Theory</li> <li>An aliased table-expression (i.e., a View, etc.) in SQL is the same thing as a Rule in Prolog.</li> </ol> <p>So what are their differences? Although they operate across the same conceptual domains, their focuses are in completely different directions. In Prolog terms, SQL is primarily a Fact and Relation(set) engine, whereas Prolog is primarily a Rules and Inferencing engine. Each can do the other, to a limited extent, but it becomes increasingly difficult with even small increases in complexity. For instance, you can do inferencing in SQL, but it is almost entirely manual in nature and not at all like the automatic forward-inferencing of Prolog. And yes, you can store data(facts) in Prolog, but it is not at all designed for the "storage, retrieval, projection and reduction of Trillions of rows with thousands of simultaneous users" that SQL is.</p> <p>Plus, SQL is primarily a Server-language paradigm, whereas Prolog is primarily a Client-language paradigm.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload