Entering Data with the INSERT Statement

The INSERT statement enables you to enter data into the database. It can be broken down into two statements:

INSERT...VALUES

and

INSERT...SELECT

Entering One Record with the INSERT...VALUES Statement

The INSERT...VALUES statement enters data into a table one record at a time. It is useful for small operations that deal with just a few records. The syntax of this statement is as follows:

INSERT INTO table_name
(col1, col2...)
VALUES(value1, value2...)

The basic format of the INSERT...VALUES statement adds a record to a table using the columns you give it and the corresponding values you instruct it ...

Get Sams Teach Yourself SQL in 21 Days, Fourth 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.