Consider two tables in a relational database with columns and rows as follows:…
GATE · 2004 · IT
Consider two tables in a relational database with columns and rows as follows:

Roll_no is the primary key of the Student table, Dept_id is the primary key of the Department table and Student.Dept_id is a foreign key from Department.Dept_id What will happen if we try to execute the following two SQL statements?
update Student set Dept_id = Null where Roll_no = 1update Department set Dept_id = Null where Dept_id = 1
- A.
Both (i) and (ii) will fail
- B.
(i) will fail but (ii) will succeed
- C.
(i) will succeed but (ii) will fail
- D.
Both (i) and (ii) will succeed
Attempted by 839 students.
Sign up free to check your answer
Sign up freeLoading lesson…