What SQL Is and What It Isn’t

SQL is not a procedural language.

Procedural languages such as C++ or Python operate on data items one item at a time. People who program in languages such as C++ and Python write procedures that perform a sequence of operations one after another until an entire task is completed.

SQL is considered a non-procedural language because when you use it, you do not code instructions to perform a sequence of operations. In other words, you do not specify a sequence of operations to perform a task. Instead, you merely tell the DBMS you are using what you want done, and it would proceed to do it without any further instructions from you. If what you want is to retrieve specific information from a set of database records, just specify exactly what you want, and the DBMS will decide how best to satisfy your request, then return the result to you.

Application programmers embed SQL statements in their programs to interact with databases, and use procedural code to construct user interfaces, screens, reports, and program logic. If all you want to do is retrieve some data from a database to answer a question, you don’t need to go to all the trouble of writing a program. You can just feed an SQL statement directly to the DBMS and read out the result when it is returned to you.

For people who are not programmers, and who do not intend to become one, a working knowledge of how to craft SQL queries can be very useful. Even if an application program with embedded SQL exists for a database, questions are bound to arise that were not anticipated when that application program was written. It can be quite valuable to be able to answer such questions quickly and easily with a simple SQL query.

If you think that a basic knowledge of SQL might be helpful to you, click here to find out about a short course that will bring you up to speed.

Leave a Reply