Subject / 421 questions

Programming MCQs

Page 6 of Programming multiple-choice questions with answers. Tap an option to check yourself.

Page 6 of 22

Advertisement
Question 104 DBMS and SQL

What does strict two-phase locking add to basic 2PL, and what problem does it remove?

Correct answer B. Exclusive locks are held until commit or abort, which removes cascading aborts

Open question
Question 108 DBMS and SQL

What does the write-ahead logging (WAL) rule require?

Correct answer B. Log records describing a change must reach stable storage before the changed data page does

Open question
Advertisement
Advertisement
Question 116 DBMS and SQL

Emp.dept_id is a foreign key referencing Dept(id), declared with no ON DELETE action. What happens if you try to delete a Dept row that some Emp rows still reference?

Correct answer D. The delete is rejected with a foreign key violation

Open question
Question 117 DBMS and SQL

Emp.dept_id is a foreign key to Dept(id) and is not declared NOT NULL. What happens when you insert an Emp row with dept_id set to NULL?

Correct answer B. The insert succeeds, because a NULL foreign key is not checked

Open question