Difference between revisions of "Insert Queries"
(→Basic Quiz) |
(→Basic Quiz) |
||
Line 28: | Line 28: | ||
| Joe || Bloggs || 1 Some Street || Sheffield || 35 | | Joe || Bloggs || 1 Some Street || Sheffield || 35 | ||
|} | |} | ||
− | + | ||
|type="()"} | |type="()"} | ||
+ Insert Into Employees ('First Name', 'Last Name', 'Address', 'City', 'Age') Value ('Joe', 'Bloggs', '1 Some Street', 'Sheffield', 35) | + Insert Into Employees ('First Name', 'Last Name', 'Address', 'City', 'Age') Value ('Joe', 'Bloggs', '1 Some Street', 'Sheffield', 35) | ||
||Correct | ||Correct | ||
− | - | + | - Insert Into Employees ('First Name', 'Last Name', 'Address', 'City', 'Age') Value ('Joe', 'Bloggs', '1 Some Street', 'Sheffield', 35) |
||Incorrect | ||Incorrect | ||
− | - | + | - Insert Into Employees ('First Name', 'Last Name', 'Address', 'City', 'Age') Value ('Joe', 'Bloggs', '1 Some Street', 'Sheffield', 35) |
||Incorrect | ||Incorrect | ||
− | - | + | - Insert Into Employees ('First Name', 'Last Name', 'Address', 'Age', 'City') Value ('Joe', 'Bloggs', '1 Some Street', 'Sheffield', 35) |
||Incorrect | ||Incorrect | ||
Revision as of 10:05, 28 September 2020
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);
Basic Quiz
All these questions will use this table called Employees: