Consider a relation geq which represents "greater than or equal to", that is, geq only if .
create table geq
(
ib integer not null,
ub integer not null,
primary key ib,
foreign key (ub) references geq on delete cascade
);
Which of the following is possible if tuple (x,y) is deleted?
View worked solution
Answer: C
In the relation geq, the primary key is ib and the foreign key is ub, which references ib. The relation represents the "greater than or equal to" condition, meaning for any tuple , we must have .
When we delete the tuple :
- The primary key is deleted.
- Due to
ON DELETE CASCADE, any tuple with foreign keyubmust also be deleted. Let this tuple be . Since , we have . If , then . - Deleting the tuple means its primary key is deleted.
- This deletion cascades to any tuple whose foreign key is .
Since , the deleted tuple satisfies the condition . Therefore, it is possible that a tuple with is deleted.
Free practice · Your answers on this page are not saved.
