edited by
3,435 views
4 votes
4 votes

Following table has two attributes Employee_id and Manager_id, where Employee_id is a primary key and manager_id is a foreign key referencing Employee_id with on-delete cascade:

$$\begin{array}{|c|c|} \hline \text{Employee_id} & \text{Manager_id} \\ \hline 20 & 40 \\ \hline 25 & 40 \\ \hline 30 & 35 \\ \hline 35 & 20 \\ \hline 40 & 45 \\ \hline 45 & 25 \\ \hline \end{array}$$

On deleting the table $(20,40)$, the set of other tuples that must be deleted to maintain the referential integrity of table is

  1. $(30, 35)$ only
  2. $(30, 35)$ and $(35, 20)$ only
  3. $(35, 20)$ only
  4. $(40, 45)$ and $(25, 40)$ only
edited by

3 Answers

2 votes
2 votes
Yes option B IS CORRECT as to maintain the referential integrity of the table after deleting 20,40 where 20 being the PK,ANY VALUE 20 in the foreign key to be deleted and son on.

Hence (35,20 ) to be deleted.

further deleting (35,20 ) where 35 being PK and in order to maintain referential integrity any VALUE 35 in the foreign key must be deleted i.e (30,35 )

 further no value eaqual to 30 in foreign key column is found,

hence the option B is correct.
0 votes
0 votes

(30,35) and (35,20) must be deleted as values in a foreign key column must match either all the values, or a subset of the values in the referenced Primary Key.

Answer:

Related questions

3 votes
3 votes
2 answers
2
Arjun asked Jul 2, 2019
4,092 views
Which of the following features is supported in the rational database model?Complex data-typesMultivalued attributesAssociations with multiplicitiesGeneralization relatio...
3 votes
3 votes
3 answers
3
Arjun asked Jul 2, 2019
2,971 views
With respect to relational algebra, which of the following operations are included from mathematical set theory?JoinIntersectionCartisian productProjecti and ivii and iii...
5 votes
5 votes
5 answers
4
Arjun asked Jul 2, 2019
3,123 views
In relational databases, if relation R is in BCNF, then which of the following is true about relation R?R is in 4NFR is not in 1NFR is in 2NF and not in 3NFR is in 2NF an...