SQL INSERT

The INSERT command is used to add new records to a table.

Method 1 – You have values for all the fields

The order of the values must be in the same order as the columns in the table

INSERT INTO customers
VALUES (1, 'Kelly', 'Jill', '555-1040', 'someone@microsoft.com')

Method 2 – You have values for some of the fields:

Values must be entered for all required columns, otherwise the record cannot be added to the table


INSERT INTO customers (customer_id, last_name, first_name)
VALUES (1, 'Kelly', 'Jill')