SQL fundamentals
SQL is used to manipulate the data in the database and query the database. It is also used to define and change the structure of the data--in other words, to implement the data model. This you already know from the previous chapters.
In general, SQL consists of three parts:
- Data definition language (DDL)
- Data manipulation language (DML)
- Data control language (DCL)
The first part is used to create and manage the structure of the data, the second part is used to manage the data itself, and the third part—to control access to the data. Usually, the data structure is defined only once and then it is rarely changed. However, data is constantly inserted into the database, changed, or retrieved. For this reason, DML is used more often than DDL.
SQL is not an imperative programming language, which makes it different from many other languages. To be more specific, one cannot define a detailed algorithm of how the data should be processed. This might make an impression of lack of control...