Microsoft
98-361 · Question #117
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…
The correct answer is D. INSERT INTO ITEMS (Description, Completed) VALUES ('Cheese', 0). The string values TRUE and FALSE can be converted to bit values: TRUE is converted to 1 and FALSE is converted to 0.
Understanding Databases
Question
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?
Options
- AINSERT INTO ITEMS (ID, Description, Completed) VALUES (1, 'Cheese', 0)
- BINSERT INTO ITEMS (Description, Completed) VALUES ('Cheese', 1)
- CINSERT INTO ITEMS (10, Description, Completed) VALUES (NEWID(), 'Cheese', 6)
- DINSERT INTO ITEMS (Description, Completed) VALUES ('Cheese', 0)
How the community answered
(35 responses)- A3% (1)
- B6% (2)
- C11% (4)
- D80% (28)
Explanation
The string values TRUE and FALSE can be converted to bit values: TRUE is converted to 1 and FALSE is converted to 0.
Topics
#SQL INSERT#DML#auto-increment#boolean values
Community Discussion
No community discussion yet for this question.