Difference between revisions of "Insert Queries"
(→Basic Quiz) |
|||
Line 26: | Line 26: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | | Joe || Bloggs || 1 Some Street || | + | | 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) |
||Correct | ||Correct | ||
- Select * from Employees | - Select * from Employees |
Revision as of 10:04, 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: