Procedural and non-procedural query language difference

There is a myth that relational algebra notations are procedural and relational calculus notations are not. But every relation expression corresponds to a certain calculus expression with the same tree structure. So it cannot be procedural when calculus is not. You can implement/execute a query in either notation per its expression tree–or not.

A (query) language is procedural when it has to use looping or otherwise relies on state. The alternative is often called declarative or functional.

Any database notation that updates the database is procedural, including SQL. But that’s not “querying”. Typically DBMSs have extensions to SQL that allow you to partially control query execution and/or data storage order in terms of implementations concepts; that’s non-procedural. But that’s not SQL.

Leave a Comment