15 votes 15 votes How many minimum relations required for given ER diagram ? Databases er-diagram databases er-to-relational relational + – targate2018 asked Aug 12, 2017 targate2018 8.6k views answer comment Share Follow See all 36 Comments See all 36 36 Comments reply Show 33 previous comments Doraemon commented Apr 6, 2020 reply Follow Share @Satbir I have a few questions. 1>while converting for ER-model to relational model foreign keys can only point to candidate keys.? 2>if we have a table X(A,B) where A and B are the attributes and A and B form the compound keys,then if we have a table Y(P,Q,R) where R is the foreign key of Y we can have (PQ ) as the foreign key in Y which points to the compund key (AB).? 3>foreign keys cannot point to non-key attributes.right? Please answer. 0 votes 0 votes Satbir commented Apr 6, 2020 reply Follow Share foreign keys point to primary keys , not candidate keys. A candidate key is a key which has the capability to become a primary key, but there is only 1 primary key in a table. https://stackoverflow.com/questions/42268886/how-to-have-a-foreign-key-pointing-to-two-primary-keys 1 votes 1 votes Doraemon commented Apr 6, 2020 reply Follow Share https://csedoubts.gateoverflow.in/16478/self-doubt-dbms-er-diagrams That mean here RELATIONAL MODEL no.1 is correct .right? 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes R4 Relationship is not given, therefore, if we want to have minimum no. of tables, we can consider R4 as either 1:1 or 1:N Relationship. Entities - we have 5 Entities (E1, E2, E3, E4 and E5 (weak entity)). For each Entity, we have a Relation (or, table). Therefore, 5 Tables are required. Attributes - Since, we don't have any Multi-valued Attribute, we don't require any Relation (or, table). Relationship - Except R1, R2 (Both are many to many Relationship. R2 is recursive relationship) and R5 (a Identifying Relationship), all the other Relations are either 1:1 or 1:N, therefore, we don't require Relation (or, table) for these Relationships. We require a Relation (or, table) for many to many Relationship. Hence, two Relations (or, table) as we have two many to many Relationship (i.e. R1 and R2). Total = 5 + 0 + 2 = 7 ayushsomani answered Aug 31, 2019 edited Sep 10, 2019 by ayushsomani ayushsomani comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes 5 for each entity set and 3 different tables for the relationships R1, R2 and R5 since they are many-to-many relationships.Thus, total 8. Hardik1997 answered Aug 24, 2017 Hardik1997 comment Share Follow See all 4 Comments See all 4 4 Comments reply aehkn commented Sep 19, 2017 reply Follow Share R5 is a 1 to 1 relationship given in diagram 1 votes 1 votes reena_kandari commented Oct 15, 2017 reply Follow Share E1(A,B,C) R1(A,D) E2(D,E) R2(D,D') E4R5(K,L,F) E3(F,G) E5(H,I,J,F) R3(D,F) NOTE: We can not merge $E_{1}R_{4}E_{4}$ Bcz in $R_{1}(A,D))$ $A$ have to refers to "PK" of $E1$ and if we merge $E_{1}R_{4}E_{4}$ then ${A,K}$ will be PK of this table not just $A$ 0 votes 0 votes vamp_vaibhav commented Dec 27, 2017 reply Follow Share Reena... What is the problem in merging E1R4E4.. I mean in relation we get A nd K where K is on total participation side with no null values if we merge the table K alone can be the primary key of table.. 0 votes 0 votes jatin khachane 1 commented Oct 25, 2018 reply Follow Share @reena _kandari If we merge E1R4E4 ,,K will be in new primary key, But anyway in R1(A,D) A refers to PK which is A,,but in our new merge table K will be key, So foreign key A is refering to A in E1 which is not primary key anymore now . Is this possible ?? 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Refer this : https://gateoverflow.in/143588/minimum-number-of-tables-to-represent-er-diagram#c173569 targate2018 answered Dec 27, 2017 targate2018 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes 7 tables flash12 answered Jan 23, 2018 flash12 comment Share Follow See 1 comment See all 1 1 comment reply gauravkc commented Jan 23, 2018 reply Follow Share Even I am getting 7 tables Can someone verify? 0 votes 0 votes Please log in or register to add a comment.