Insert Queries

From TRCCompSci - AQA Computer Science
Revision as of 18:46, 23 October 2017 by M0hk4l3 (talk | contribs) (Changes keyword ambiguity)
Jump to: navigation, search

INSERT adds rows to an existing table, there can be different syntax depending on specific version of SQL etc. For exam questions use one of the methods below. Also remember the values inserted should match the data types of the table fields.

Best Method

 INSERT INTO table_name
 (field1, field2, field3)
 VALUES
 (value1, value2, value3);

Alternative Method

 INSERT INTO table_name
 VALUES
 (value1, value2, value3);