Difference between revisions of "Insert Queries"
(→Basic Quiz) |
(→Basic Quiz) |
||
Line 45: | Line 45: | ||
|} | |} | ||
− | + | # Insert Into Employees ('First Name', 'Last Name', 'Address', 'City', 'Age') Values ('Fred', 'Danson', '12 East Road', 'Leeds', 60) | |
− | + | # Insert Into Employees Values ('Fred', 'Danson', '12 East Road', 'Leeds', 60) | |
− | + | # Insert Into Employees Values ('Fred', 'Danson', '12 East Road', 60, 'Leeds') | |
+ | |type="()"} | ||
- 1 & 2 & 3 | - 1 & 2 & 3 | ||
||Incorrect | ||Incorrect |
Revision as of 10:12, 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: