0
How to solve this kind of database questions?
5 ответов
+ 9
Preity a relation R(AB) is given where A is primary key and B is foreign key refining the same relation R again the table will be created with the both values (a, b)
So when table is created with mentioned relation R(AB) the values should be present in table b which are already present table a unless the relation will be proved as wrong
▶Option 1:-
(a1, a2), (a2, a3), (a3, a4), (a4, a5)
Here by the first input relation the relation R(AB) is proved wrong as first (a1, a2) there is no a2 present in table A so table B contain an entry which is not present in table A so the relation proved wrong, all other input set for this option is same so worked in same way by which this option is incorrect
▶Option 2:-
(a1, null), (a2, a1), (a4, a3), (a3, a2)
First input set (a1, null) it will be inserted and according to the relation
2nd input set (a2, a1) since in last table value a1 is inserted so table B can contain a1 so this is correct too
To be continued......
+ 7
Preity
3rd input set (a4,a3) as a3 is not present or inserted till now so this value a3 is violating the relation and so by this way this option is wrong too
▶Option 3:-
(a1,null), (a2, a1), (a3, a2), (a4, a5)
So 1st set (a1,null), both are inserted at initial so no violation of relation
2nd input set (a2, a1), a2 is inserted in table A and a1 which is previously inserted in table a can be inserted now in table b so no violation
3rd input set (a3, a2), a3 inserted in table A and a2 which previously inserted in table a will be inserted in table b so no violation
4th input set (a4, a5) as a5 is not present or inserted till now in table so relation is violate and thus the option is false
So at last final answer is none of these option which is option D
here is an paper representation for that inputs
https://cdn.discordapp.com/attachments/510397129638805537/646302240599965715/IMG-20191115-WA0053.jpg
0
~ swim ~ can you help in this?
0
Thanks GAWEN STEASY ~ swim ~