You have a table named ITEMS with the following fields:
ID (integer, primary key. auto generated)
Description (text)
Completed (Boolean)
You need to insert the following data in the table:
“Cheese”, False
Which statement should you use?
A.
INSERT INTO ITEMS (ID, Description, Completed) VALUES (1, ‘Cheese’, 0)
B.
INSERT INTO ITEMS (Description, Completed) VALUES (‘Cheese’, 1)
C.
INSERT INTO ITEMS (10, Description, Completed) VALUES (NEWID(), ‘Cheese’,
6)
D.
INSERT INTO ITEMS (Description, Completed) VALUES (‘Cheese’, 6)
The ID column is auto generated, so the right answer would be letter B. This prevents from getting an error if the value chosen for the ID column is already in the table.
http://www.cubrid.org/wiki_tutorials/entry/how-to-insert-data-into-tables-with-auto_increment-columns
yes, but Completed must be false (all are incorrect)
No correct answer from the listed ones.
The correct is
INSERT INTO ITEMS (Description, Completed) VALUES (‘Cheese’, 0)
which is not in the answer list above.
I agree, 1 cannot be equal to false.
Mo is correct, all listed options are incorrect. What he posted is correct.