INSERT – One Row
To INSERT a single row into a table, the column names must be specified, or the field values must be in the same exact order as the columns are defined in the table.
Positional INSERT: INSERT INTO table
VALUES (value1, value2, NULL, ...);
or
Named Columns: INSERT INTO table
(column1, column2, column3, ...)
VALUES (value1, value2, NULL, ...);
> The columns not specified in the positional INSERT must be created as NULL or NOT NULL with DEFAULT.
> The values specified must be compatible with the respective column’s data type or be convertible to that data type.
> Character and datetime data types must be enclosed by quotation marks.
> Numeric data and the keyword NULL must not be enclosed with quotation marks.
> A value of two single quotes (”) with no spaces between the quotes also symbolizes a NULL.
> These statements do not return a result, but your RDBMS will normally return a message showing that the statement executed successfully and it should show the number of rows affected by the change.
> An inserted value can not violate a CHECK constraint. See Check Constraint.
> An inserted foreign key value must contain NULL (if it is allowed) or an existing key value from the primary or unique key referenced by the foreign key. See Primary Keys and Foreign Keys.