Structured Query Language (SQL) is an English-based element that provides you with the ability to ask questions of a database and get answers to those questions.
SQL was initially developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. This version, initially called SEQUEL (Structured English Query Language), was designed to manipulate and retrieve data stored in IBM's original
quasi-relational database management system, System R, which a group at IBM San Jose Research Laboratory had developed during the 1970s.
The acronym SEQUEL was later changed to SQL because "SEQUEL" was a trademark of the UK-based Hawker Aircraft Company.
In the late 1970s, Relational Software, Inc. (now Oracle Corporation) saw the potential of the concepts described by Codd, Chamberlin, and Boyce and developed their own SQL-based RDBMS with aspirations of selling it to the U.S. Navy,
Central Intelligence Agency, and other U.S. government agencies. In June 1979, Relational Software, Inc. introduced the first commercially available implementation of SQL, Oracle V2 (Version2) for VAX computers. After testing SQL at customer test sites to determine the usefulness and practicality of the system, IBM began developing commercial products based on their System R prototype including System/38, SQL/DS, and DB2, which were commercially available in 1979, 1981, and 1983, respectively.
SQL is a bit different from developing applications that gather this information from the database by manipulating the database directly.
In those cases, the application is responsible for determining how the information is analyzed and retrieved. With SQL, you do not have to indicate how you want information retrieved, you only indicate what criteria you want to use. This is called a declarative language.
SQL (Structured Query Language) indeed embodies the characteristics of a declarative language.
To comprehend this, it is essential to first understand what a declarative language is. Declarative languages are a class of programming languages where the programmer specifies what the program should accomplish, rather than detailing how it should achieve the result. These languages are often used for problems that involve a significant amount of data manipulation.
SQL is a declarative language primarily used for managing and manipulating relational databases. It focuses on describing what the result of a query should look like, rather than specifying the steps to get there. This is achieved through the provision of high-level commands that abstract the underlying procedural details of querying databases. As such, it is the database management system's responsibility to determine the most efficient means to execute the given query, which is a testament to the declarative nature of SQL.
For example, if a user wishes to retrieve data from a database table, they can use a SQL command like the following:
SELECT * FROM Employees
WHERE Salary > 50000;
In this command, the user is declaring the intention to select all records from the "Employees" table where the "Salary" is greater than 50000. Note that the user is not specifying how this selection should be made, only the desired outcome. The database management system is tasked with determining the optimal method to execute this query.
Furthermore, SQL's declarative nature is not limited to the retrieval of data. It extends to the definition of data (data definition language, or DDL), modifications of data (data manipulation language, or DML), and even access control to data (data control language, or DCL).
In conclusion, SQL unequivocally embodies the characteristics of a declarative language as it emphasizes the "what" in achieving a particular outcome, allowing the database management system to work out the "how".
A declarative language is a language in which you simply indicate what you need and let the database engine get it for you. How the information is actually gathered is irrelevant to the user.
In the next lesson, a sample SQL statement will be examined.