SQL is used to interact with databases: to create and maintain data structures; to put data into a database; and to change it, to retrieve it, and delete it. SQL has commands related to DDL, DML, and DCL. In this chapter, we looked at the four SQL statements that form the basis of DML: SELECT, INSERT, UPDATE, and DELETE.
The SELECT statement was examined in detail to explain SQL concepts such as grouping and filtering, to show SQL expressions and conditions, and to explain how to use subqueries. Additionally, some relational algebra topics were covered in the section "Selecting from multiple tables".
In the next chapter, we will cover more complicated topics, such as some advanced SQL features and techniques, and the programming language PL/pgSQL, which can be used to implement functions in PostgreSQL.