Adding records

To add a record to a table, use the INSERT command and specify at least some field information. For example, to add a new employee to the Employee table (see Employee table), we’d at least need to assign a new EmployeeID:

INSERT INTO Employee (EmployeeID) VALUES (1006);

To create a new record and fill in the field details at the same time, list the fields after the table, and each value in order after the VALUES keyword:

INSERT INTO Employee (EmployeeID, FirstName, LastName, Department, Age, JoinDate) VALUES (1007, "Joel", "Coleman", "ADMIN", 49, #1/5/97#);

Note that you surround each new value with quotes, unless the field is of a numeric type where the quotes are omitted or date where the hash "#" sign is used instead. Also note that both the field list and the values list are enclosed with brackets.

See also:

Adding multiple records

Creating tables from existing data

Updating records

Deleting Records

Other types of SQL statements