Structured Query Language (SQL)
Users were not entirely happy with this situation. While they could access
data, it often required convincing a DBMS programmer to write special software.
For example, if a sales department wanted to see the total sales in the previous
month by each of its salespeople, and it wanted this information ranked in
order by each salesperson’s length of service in the company, it had two choices:
Either a program already existed that allowed the information to be accessed in
exactly this way, or the department had to ask a programmer to write such a
program. In many cases, this was more work than it was worth, and it was always an
expensive solution for one-time, or ad-hoc, inquiries. As more and more users wanted easy access, this problem grew
larger and larger.
Allowing users to access data on an ad-hoc basis required giving them a
language in which to express their requests. A single request to a database is
defined as a query; such a language is called a query language. Many query languages were developed for this purpose but one of these became
the most popular: Structured Query Language, invented at IBM in the 1970s. It is more commonly known by its acronym, SQL, and is pronounced both as “ess-cue-ell” and “sequel”; this manual uses the
former pronunciation. SQL became an ANSI standard in 1986 and an ISO standard in
1987; it is used today in a great many database management systems.
Although SQL solved the ad-hoc needs of users, the need for data access by
computer programs did not go away. In fact, most database access still was (and
is) programmatic, in the form of regularly scheduled reports and statistical
analyses, data entry programs such as those used for order entry, and data
manipulation programs, such as those used to reconcile accounts and generate work
orders.
These programs also use SQL, using one of the following three techniques:
Note It is a historical accident that the term Call-Level Interface is used
instead of Application Programming Interface (API), another term for the same
thing. In the database world, API is used to describe SQL itself: It is the API to a
DBMS.
Of these choices, embedded SQL is the most commonly used, although most major
DBMSs support proprietary CLIs.
Embedded SQL, in which SQL statements are embedded in a host language such as C or COBOL.
SQL Modules, in which SQL statements are compiled on the DBMS and called from a host
language.
Call-Level Interface, or CLI, which consists of functions called to pass SQL statements to the
DBMS and to retrieve results from the DBMS.