Data Manipulation Language
The Data Manipulation Language is all about getting user data in and out of the database. After all the data structures and other database objects have been created with DDL commands, DML commands can be used to load those data structures full of useful data.
The DML supported by SQLite falls into two basic
categories. The first category consists of the “update” commands, which
includes the actual UPDATE command, as
well as the INSERT and DELETE commands. As you might guess, these
commands are used to update (or modify), insert, and delete the rows of a
table. All of these commands alter the stored data in some way. The update
commands are the primary means of managing all the data within a
database.
The second category consists of the “query” commands,
which are used to extract data from the database. Actually, there is only
one query command: SELECT. The SELECT command not only prints returned
values, but provides a great number of options to combine different tables
and rows and otherwise manipulate data before returning the final
result.
SELECT is,
unquestionably, the most complex SQL command. It is also, arguably, the most
important SQL command. This chapter will only cover the very basics of
SELECT, and then we will spend the
next chapter going through all of its parts, bit by bit. To address the full
command syntax in detail, SELECT gets a
whole chapter to itself (Chapter 5).
Row Modification Commands
There are three commands used for adding, modifying, ...