Font size
WorksheetsCS10337 - Lecture #5
Total questions: 10
Worksheet time: 5mins
What is the purpose of transaction locking?
To prevent unauthorized access
To ensure data integrity during concurrent access
To speed up data retrieval
To encrypt data
Which of the following is a correct way to insert a row without specifying column names?
INSERT INTO table_name (column1, column2) VALUES (value1, value2)
INSERT INTO table_name VALUES (value1, value2)
INSERT INTO table_name SET column1 = value1, column2 = value2
INSERT INTO table_name (column1, column2) SET (value1, value2)
What is the correct syntax for using a subquery to insert one or more rows into a table?
INSERT INTO table_name VALUES (value_list)
INSERT [INTO] table_name [(column_list)] select_statement
SELECT * FROM table_name WHERE condition
UPDATE table_name SET column = value
What is the default mode for MySQL Workbench regarding updates?
Safe update mode
Fast update mode
Manual update mode
Automatic update mode
What does safe update mode prevent in MySQL Workbench? (Multiple Correct Answers)
Deleting rows without a WHERE clause
Updating rows if the WHERE clause is omitted
Inserting rows without a primary key
Creating tables without a foreign key
Which SQL statement would delete a row from 'invoice_line_items' where the invoice_id is 78 and invoice_sequence is 2?
DELETE FROM invoice_line_items WHERE invoice_id = 78 AND invoice_sequence = 2
DELETE FROM invoice_line_items WHERE invoice_id = 78 OR invoice_sequence = 2
DELETE FROM invoice_line_items WHERE invoice_id = 77 AND invoice_sequence = 2
DELETE FROM invoice_line_items WHERE invoice_id = 78 AND invoice_sequence = 3
How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
Which of the following is NOT part of the ACID properties?
Atomicity
Concurrency
Consistency
Durability
What does the “Atomicity” property ensure in a transaction?
Every query in a transaction must be read-only
Transactions must be written in uppercase
The entire transaction is processed as a single unit – all or nothing
Transactions run one at a time only
True or False: InnoDB supports all four ACID properties: Atomicity, Consistency, Isolation, and Durability.
True
False
