SQL insert into statement
Add data to a table using the INSERT statement. The insert into statement can be used to append a record table or append multiple records from one table to another.
The syntax of the INSERT statement is:
Insert into table_name (column1, column2 ,...)
VALUES (value1, value2 ,....)
Instance
Insert into AntiqueOwners (OwnerID, OwnerLastName, OwnerFirstName)
VALUES (4, 'Peter ', 'novitski ')
To add a specific record table, the insert into statement is followed by the table name and domain name. Insert each clause value in the value to the position of the corresponding field value in the list: the first value is inserted in the first field, enter the second of the second field, etc.
This will cause a record to be inserted into the AntiqueOwners table. This new record will have 4 OwnerID, a Peter OwnerLastName and Novitski OwnerFirstName.
Note: If you omit the field list, you must include the values of each field in a table. Otherwise, the Operation will fail. Values must also be separated by commas. Text and date fields must also be enclosed in single quotes ('').
An automatic number field (also known as the Anti-terrorism field) is a data type that automatically creates and stores a number for each project to be added to the table. If you do not want the AutoNumbered field to be re-numbered, you must include the auto-numbered field in the query. If the automatic number field is not included, the additional project will be assigned a new value for the automatic number field.
Example #2
Insert into AntiqueOwners (OwnerID, OwnerLastName, OwnerFirstName)
SELECT EmployeeIDNo, LastName, FirstName
FROM EmployeeAddressTab
Le
WHERE City = 'upton'
When a Select statement is used before the insert into statement of the Multi-record syntax, one or more records are added to the table. This is called append query and replication because it records from one or more tables to another. The records in this table are appended and are not affected by the operation.