62 votes 62 votes An ER model of a database consists of entity types $A$ and $B$. These are connected by a relationship $R$ which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A? Relationship $R$ is one-to-many and the participation of $A$ in $R$ is total Relationship $R$ is one-to-many and the participation of $A$ in $R$ is partial Relationship $R$ is many-to-one and the participation of $A$ in $R$ is total Relationship $R$ is many-to-one and the participation of $A$ in $R$ is partial Databases gatecse-2017-set2 databases er-diagram normal + – Madhav asked Feb 14, 2017 edited Jan 18, 2018 by Puja Mishra Madhav 22.2k views answer comment Share Follow See all 19 Comments See all 19 19 Comments reply Show 16 previous comments goxul commented Feb 1, 2020 reply Follow Share @JashanArora Yeah, they shouldn't leave it up to interpretation. However, if you see Korth and the accompanying slides, this is the convention that they follow as standard. 0 votes 0 votes Surya_Dev Chaturvedi commented Dec 14, 2020 reply Follow Share As we all confused in C & D. firstly I go through wrong Answer, Which is in our mind. If we take partial participation on A side than also, we have to merge R with A and Only 2 Tables are there i.e. (A,R) and (B). Now Visualize It : If we merge R with A and their is partial participation which means we can put NULL values when there is no Relation from A to B. So lets assume there are lots of entities present in A which does not depends on B, so in relation we have to Put NULL values in place of Foreign key. When We put lots of NULL values and there are only few entities which has participation with B, Than our table become too Lengthy with redundancy , so instead of this we make another table for R because A has only few entities which has some relations with B. So Now there are only 3 Tables (A with foriegn key of R) and (R with Foriegn key of B and Foriegn key of A) and Table B with foriegn key of A) So I think Now you realise why option C is better choise than D. Now you have one doubt remaing. How many minimum tables are required in A has many -to- one relation with B and Both have partial participation ? Ans) 2 (A and R with Foreign key of B) and (B with Foreign key of A). So Doubt is – Here we are taking 2 tables and merging R with A , so why not we merge in this question ? Because In this question it is saying tell me Minimum number of table (so it also include the REDUNDANCY) But when we want our solution redundancy free, than we make different table for R. SO I think it is more clear now. If Yes UPVOTED else DOWNVOTED. 18 votes 18 votes Shiva Sagar Rao commented Jan 19, 2021 reply Follow Share As per GATE 2017 official Key only Option C was correct. If link doesn’t work use archive: https://web.archive.org/web/20210113064019/https://www.gate.iitg.ac.in/2017answers/CS2.pdf 0 votes 0 votes Please log in or register to add a comment.
Best answer 42 votes 42 votes The relation table for R should always be merged with the entity that has total participation and relationship should be many to one. Answer is C. Arnabi answered Feb 14, 2017 edited Jun 21, 2018 by Milicevic3306 Arnabi comment Share Follow See all 27 Comments See all 27 27 Comments reply Shreya Roy commented Feb 15, 2017 reply Follow Share what will be the problem if foreign key remains null? 0 votes 0 votes Kaluti commented Feb 21, 2017 reply Follow Share I think foreign key can be null 1 votes 1 votes Kaluti commented Feb 21, 2017 reply Follow Share Total participation ensures no null values in foreign key correct if I am wrong 5 votes 5 votes Arjun commented Feb 27, 2017 reply Follow Share @Shreya no issues except wastage of space. Technically D is possible but C is a better choice. I mean there is no logical reason to chose D option over C. Instead of C, had "none of these" been a choice then one should pick D. 28 votes 28 votes Puja Mishra commented Nov 7, 2017 i reshown by Puja Mishra Jan 18, 2018 reply Follow Share @arjun sir y do u think "none of these" ??? can u give me an example ?? C Will be the answer if its A to B (many to one) ..though they havnt mentioned anything abt the order ... 0 votes 0 votes Shubhanshu commented Jan 19, 2018 reply Follow Share Such question should not be given in Gate. 3 votes 3 votes Sunny Mukherjee commented Jan 21, 2018 reply Follow Share @puja can you tell me one thing as i am confused.. "Relationship R is many-to-one and the participation of A in R is total" total participation i know but does this mean that every P.K. of A can have exactly one relation with B and every P.K. of B can have many relations with A? or did i just tell the opposite? 0 votes 0 votes jatin khachane 1 commented Oct 22, 2018 reply Follow Share @Arjun sir, Relational table for R be merged with that of A In 1:M relationship we are adding Foreign key on M side relation right ? We are not creating relation table for R and then merging it with relation on M side ? Where m i getting it wrong are both terms same ?? 0 votes 0 votes lakshaysaini2013 commented Oct 25, 2018 reply Follow Share yes, we add the foreign key on M side in 1: M (because M values can map to 1 values of another set) and we are not creating the table for R as we don't have any attribute on R. 0 votes 0 votes Shaik Masthan commented Oct 25, 2018 reply Follow Share @jatin khachane 1 in 1:M ===> the primary key of 1 side Entity will add as Foreign key at the table of M side entity. But Before coming to this conclusion, we generally create each table for each entity and relationship of ER diagram. table of A() , table of B() and table of Relationship() then we can conclude that, the relationship Primary key is same as primary key of table A() ===> this will lead us to come that conclusion 0 votes 0 votes jatin khachane 1 commented Oct 25, 2018 reply Follow Share It is formally how foreign key is added to M side....at first place to know whther should we do that we have to create relationship table ...?? But actually we didn't maintain any relationship table extra in 1:m right ? So question is indirectly asking we can merge relationship on which side ?? 0 votes 0 votes Shaik Masthan commented Oct 25, 2018 reply Follow Share But actually we didn't maintain any relationship table extra in 1:m right ? yes, after coming to the conclusion onwards we didn't create a table for relationship. So question is indirectly asking we can merge relationship on which side ?? yes 0 votes 0 votes jatin khachane 1 commented Oct 25, 2018 reply Follow Share Thanks :) 0 votes 0 votes prashant jha 1 commented Jan 1, 2019 reply Follow Share @Arjun sir , So you are saying that if there is a partial participation then merging should never be done and instead another table be made? Because , I am confused , since partial participation makes it a loose constraint , else always a NOT NULL clause is required. 1 votes 1 votes mrinmoyh commented Jul 7, 2019 reply Follow Share @Shaik Masthan sir, According to NAVATHE(6th Ed, pg - 218, section - 7.4.4, 3rd para 1st line) - For 1:N relationship type, a relationship attribute can be migrated only to the entity type on the N-side of the relationship. here nothing is told about total or partial participation on either side. This means migrating relationship doesn't depend on participation??? If I accept the NAVATHE conclusion then both option C & D is correct.right??? Now in order to distinguish b/w C & D, I've tried a concept, "what if they asked to merge A,B & R into one single table" Then in that case if we do so, option D corresponding table will not have any Primary key(Letting some arbitary attribute for A & B). but option C corresponding table has a primary key & it's possible. Can this be an approach to solve this question???? 4 votes 4 votes Satbir commented Jul 16, 2019 reply Follow Share Please note that they have not told in the question whether A is strong entity or weak entity that is why we can't use option D. if it had been mentioned that A has its own Primary key then both c and d were correct. 3 votes 3 votes mrinmoyh commented Jul 16, 2019 reply Follow Share Satbir can't understand. what you've said. If R is M-to-1 & relationship will be merged to A then A has only one choice - that A should present at M side,that's it. it will not look whether A will totally or partially participate with R.If A is on M side then relationship will mergerd with A otherwise not. assuming that A is on left side of relationship. 0 votes 0 votes Satbir commented Jul 16, 2019 reply Follow Share if $A$ is a weak entity $\implies$ it does not have a primary key $\implies$ some attributes are duplicate in each row and some may have NULL values then on what basis will you merge the relation table with A ? (A row may also contain all NULL values for each attribute) We have to first relate each row of $A$ with $B$ using relations right ? This means that every tuple of $A$ should be related with any one of the tuples in $B$ using relations $\implies$ $A$ is totally participating in R. 0 votes 0 votes mrinmoyh commented Jul 16, 2019 reply Follow Share Satbir then also A is on M side(considering A is an weak entitiy)\ An employee can have many dependent, not many employee can have one dependent(suppose here A is dependent).So A is totally partcipated with depends_on relation with M cardinality. suppose(forget about weak entity concept) if A is on M side & A is partial then also relationship will be merged with A (doesn't depends B is totally or partial). My doubt is that in option C & D, if it's already declared by 1st six words that A is on M side then why are we going for another property - it's partially or total. By these words - Relationship R is many-to-one I can declare that relationship will be merged with A.I need not have to bother about whether A is totally or partially participated. Hope you got my doubt. 0 votes 0 votes Kaurbaljit commented Jul 30, 2019 reply Follow Share Indeed the relationship will be merged with Entity-A in both options C and D. But C is a better choice as mentioned by Arjun sir in one of the above comments.Its just that,space will get wasted in option D over C. So better to go with option C only. 0 votes 0 votes mrinmoyh commented Jul 30, 2019 reply Follow Share ya, that's may be a point to distinguish. for partial A, there is some NULL value occurs in B,do u mean this??? 0 votes 0 votes Kaurbaljit commented Jul 30, 2019 reply Follow Share Exactly! Foreign-key, referencing a key in entity-B will have NULL-values associated with it in the resultant MERGED-TABLE. 0 votes 0 votes Pranavpurkar commented Sep 20, 2021 i edited by Pranavpurkar Aug 4, 2022 reply Follow Share what if many to one is not given in any of the options so on the basis of participation type what will be the answer??anyone?And suppose if we have options like:Relationship R is one-to-one and the participation of A in R is totalRelationship R is one-to-one and the participation of A in R is partialRelationship R is many-to-one and the participation of A in R is totalRelationship R is many-to-one and the participation of A in R is partialand if it is an MSQ then here Ans will be A,C,D right? 0 votes 0 votes KhushiRastogi commented Sep 17, 2023 reply Follow Share It should be A,C bcs of the total participation in the relationship , IF partial participation occurs then many redundant null values will be there 0 votes 0 votes ananya_23 commented Sep 30, 2023 reply Follow Share No @khushi, A won't be possible because in 1:M or M:1, Relationship will always merge towards Many side. In option A it is 1:M (1 on A side) so definitely not correct. As far as the confusion goes with C and D, I agree with Arjun Sir's ans above that choosing option with total participation is better than partial one. 1 votes 1 votes KhushiRastogi commented Oct 7, 2023 i reshown by KhushiRastogi Oct 8, 2023 reply Follow Share @ananya_23 , in Option A it is 1:1 0 votes 0 votes ananya_23 commented Oct 7, 2023 reply Follow Share I believe it's 1:M. Please check the options.. 1 votes 1 votes Please log in or register to add a comment.
17 votes 17 votes (C) We need following two conditions: A:B = Many to one A has total participation If A to B is many to one, then for each row in table A, the relationhip can be added as an extra column. Total participation ensures that there is no null values. Kloseup answered Feb 14, 2017 Kloseup comment Share Follow See all 0 reply Please log in or register to add a comment.
9 votes 9 votes |A|===== <R> ---------|B| here relation R between A and B represent many to one with total participation at A entity, this representation is same as definition of week entity, ans is C 2018 answered Feb 14, 2017 2018 comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments PratikDey0316 commented Nov 25, 2020 reply Follow Share Can anyone explain to me how does ‘many to one ’ or ‘one to many’ affect the process of merging the relation R with A? 0 votes 0 votes arjun_harikumar commented Jan 29, 2021 reply Follow Share Consider a schema of EMPLOYEES and DEPARTMENT. The relation is WORKS FOR. Now if start date is an attribute of WORKS FOR relation. Then we associate this attribute to employee table ( n side ) and not to department table, since an employee will have only one start date for a department but department can have multiple start dates for various employees in the department. 2 votes 2 votes PratikDey0316 commented Jan 29, 2021 reply Follow Share thanks for the explanation :) 0 votes 0 votes Please log in or register to add a comment.