wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CS10337 - Lecture #5

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the purpose of transaction locking?

a)

To prevent unauthorized access

b)

To ensure data integrity during concurrent access

c)

To speed up data retrieval

d)

To encrypt data

2.

Which of the following is a correct way to insert a row without specifying column names?

a)

INSERT INTO table_name (column1, column2) VALUES (value1, value2)

b)

INSERT INTO table_name VALUES (value1, value2)

c)

INSERT INTO table_name SET column1 = value1, column2 = value2

d)

INSERT INTO table_name (column1, column2) SET (value1, value2)

3.

What is the correct syntax for using a subquery to insert one or more rows into a table?

a)

INSERT INTO table_name VALUES (value_list)

b)

INSERT [INTO] table_name [(column_list)] select_statement

c)

SELECT * FROM table_name WHERE condition

d)

UPDATE table_name SET column = value

4.

What is the default mode for MySQL Workbench regarding updates?

a)

Safe update mode

b)

Fast update mode

c)

Manual update mode

d)

Automatic update mode

5.

What does safe update mode prevent in MySQL Workbench? (Multiple Correct Answers)

a)

Deleting rows without a WHERE clause

b)

Updating rows if the WHERE clause is omitted

c)

Inserting rows without a primary key

d)

Creating tables without a foreign key

6.

Which SQL statement would delete a row from 'invoice_line_items' where the invoice_id is 78 and invoice_sequence is 2?

a)

DELETE FROM invoice_line_items WHERE invoice_id = 78 AND invoice_sequence = 2

b)

DELETE FROM invoice_line_items WHERE invoice_id = 78 OR invoice_sequence = 2

c)

DELETE FROM invoice_line_items WHERE invoice_id = 77 AND invoice_sequence = 2

d)

DELETE FROM invoice_line_items WHERE invoice_id = 78 AND invoice_sequence = 3

7.

How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?

a)

UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

b)

MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

c)

MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

d)

UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

8.

Which of the following is NOT part of the ACID properties?

a)

Atomicity

b)

Concurrency

c)

Consistency

d)

Durability

9.

What does the “Atomicity” property ensure in a transaction?

a)

Every query in a transaction must be read-only

b)

Transactions must be written in uppercase

c)

The entire transaction is processed as a single unit – all or nothing

d)

Transactions run one at a time only

10.

True or False: InnoDB supports all four ACID properties: Atomicity, Consistency, Isolation, and Durability.

a)

True

b)

False