April 2002
Intermediate to advanced
416 pages
11h 50m
English
The INSERT statement adds a new record to a database table. There are two main variations on the INSERT statement. The first explicitly lists the names of the fields for which the statement is specifying values:
INSERT INTO table_name (field1, field2, ...) VALUES (value1, value2, ...)
To insert a NULL value in a field, simply omit the field. For example, suppose the People table has the fields LastName, FirstName, and PhoneNumber. The following statement creates a new record with a NULL PhoneNumber value:
INSERT INTO People
(LastName, FirstName)
VALUES ('Crissy', 'Canon') Alternatively, you can list the field and explicitly give it a NULL value as in this example:
INSERT INTO People (LastName, FirstName, PhoneNumber) VALUES ('Crissy', ...Read now
Unlock full access