Chapter 2. Foundational Concepts

SQL provides an easy, intuitive way to interact with a database. The SQL99 standard does not define the concept of a “database,” but it does define all the functions and concepts needed for a user to create, retrieve, update, and delete data. It is important to review a few of the concepts upon which the SQL standard is based.

Row Processing Versus Set Processing

Other database manipulation languages, such as Xbase or Visual Basic, perform their data operations quite differently from SQL. These languages require the programmer to tell the program exactly how to treat the data, one record at a time. Since the program cycles down through a list of records, performing its logic on one record after another, this style of programming is frequently called row processing or procedural programming.

SQL programs operate in logical sets of data. Set theory is applied when the FROM clause is used, as in the SELECT statement. In effect, data is selected from a set called a table. Unlike the row processing style, set processing allows a programmer to tell the database simply what is required, not how each individual piece of data should be handled. Sometimes set processing is referred to as declarative processing , since a programmer declares only what data is necessary, as in “Give me all employees in the southern region who earn more than $70,000 per year,” rather than describes the exact procedure used to manipulate the data.

Tip

Set theory was the brainchild ...

Get SQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.