Difference between revisions of "Insert Queries"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "INSERT adds rows to an existing table, there can be different syntax depending on specific version of SQL etc ==Best Method== <SyntaxHighlight lang=sql> INSERT INTO table ...")
 
Line 1: Line 1:
INSERT adds rows to an existing table, there can be different syntax depending on specific version of SQL etc
+
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==
 
==Best Method==

Revision as of 13:25, 17 December 2016

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
 (field1, field2, field3)
 VALUES
 (value1, value2, value3);

Alternative Method

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