On the contrary, query languages like Relational Calculus, and the well known SQL query language are called “non procedural” since they express the expected result only through its properties, and not the order of the operators to be performed to produce it. For instance, with an SQL expression like:
SELECT t1.b
FROM t1
WHERE t1.b > 10
we specify the we want all the tuples of relation t1
for which t1.b > 10
is true, and from these we want the value of t1.b
, but we do not specify if first the projection must be performed, and then the restriction, or the restriction first and then the projection. Imagine a complex SQL query, with many joins, conditions, restrictions, etc. Many different orders of executing the query could be devised (and in effect the task of the query optimizer is that of devising an efficient order to perform these operations, so to transform this declarative query into a procedural one).
source: procedural VS non procedural