search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
0 votes
16 views

Consider the following relation R(XYZ) with X as the primary key and Z as the foreign key referencing X with a delete cascade.

X Y Z
X1 Y1 X7
X3 Y1 X2
X5 Y4 X3
X2 Y2 X1
X9 Y5 X3
X7 Y3 X8
X4 Y2 X2

 Suppose tuple (X2, Y2, X1) is deleted, as a result what will be the number of tuples in R after deletion?

in Databases 15 points 16 views
0
@shubhajit panday

Ans - 2

1 Answer

0 votes

As a result of deletion ( X2 Y2 X1) –  (X3 Y1 X2 ) , ( X4 Y2 X2 )  will be deleted.

As a result of deletion (X3 Y1 X2 )- (X5 Y4 X3 ) , ( X9 Y5 X3 ) will be deleted .

As a result of deletion ( X4 Y2 X2 ) – No tuples 

As a result of deletion ( X5 Y4 X3 ) – No tuples

As a result of deletion (  X9 Y5 X3 ) - No tuples

 

Ans will be 4 . 

PS –  since Z is referencing X , X8 must be present in X 

11 points
...