CadencePlus Solutions

INSERT INTO

INSERT adds new records. Name the destination columns so each value has a clear meaning.

Name the target columns

INSERT INTO table_name(column_a,column_b) VALUES(value_a,value_b) adds a row. Explicit column names keep your statement understandable if the table definition changes.

Match values to columns

Each VALUES tuple must have the same number of values as the named columns. Quote text with single quotes. SQL NULL represents a missing value; it is not the string 'NULL'.

Insert several rows

Separate complete VALUES tuples with commas. Every row must satisfy keys and constraints. Reusing a primary key fails rather than updating the existing record.

Check what was added

Select the new records by their keys after inserting. This lab starts with an empty evidence table for this lesson, so insert and verify in one run.