First page Back Continue Last page Image

INSERT Command Basics

In it’s Simplest form the INSERT command will place a row of data into a table

INSERT INTO `sfmembers` VALUES (NULL, 'Hugh', 'Culber', 1, '2017-09-19', 'Lieutenant Commander');

Because we did not use the optional fields argument, we must provide a value for every field in the same order as they appear in the table

If we want to only load part of the information (and that option is available via a field that can be NULL ) we have to use the fields argument as shown here

INSERT INTO `sfmembers` (memberFirstName, memberLastName, dos, rankofrecord)

VALUES ('Paul', 'Stamets', '2017-09-19', 'Lieutenant Commander');

Notice we did not provide 2 of the fields for Paul