SQL Data Manipulation Language

SQL's Data Manipulation Language (DML) defines the format of data by insertion, selection, updating, and deletion. The four primary DML statements are INSERT, SELECT, UPDATE, and DELETE, which we'll look at individually in the following sections.

The very first exercise in this chapter illustrated all of these statements. Here we'll see them at work in a little more advanced database structure, continuing with our Employee and Department table examples.

Insert

If tables are like classes in Python, then rows are like instances. Since the INSERT statement inserts values into a table, we can think of it as analogous to calling a constructor, that is, creating an instance of a record.

INSERT takes the following form: ...

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.