12.13. SQL: Updating Table Populations

Generically, an “update” of the population of the database tables may involve any of three relational operations: insert a row into a table, delete a row from a table, or modify one or more values on a row. In SQL, the modify operation is called “update” so the term is sometime used in this restricted sense.

Let’s first consider how to insert rows into a table. For this, SQL provides an insert statement in two basic forms. The first adds a single row of data to a table. Its SQL-89 syntax is:

insert into tablename [ (col-list) ]
   values[constant-list)

If no columns are listed, values for all columns must be given. Character strings must be delimited by single quotes. A null value may be entered as null. ...

Get Information Modeling and Relational Databases, 2nd Edition 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.