Subject / 929 questions

Programming MCQs

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

Page 32 of 47

Advertisement
Question 624 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 625 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
Advertisement
Advertisement
Question 639 DBMS and SQL

Which statement about decomposing a relation is always true?

Correct answer A. A lossless, dependency-preserving decomposition into 3NF always exists

Open question