I think 3 is enough...?

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+2 votes

Let A and B be two entities in an E-R diagram with simple single-valued attributes. R1 and R2 are two relationships between A and B, where R1 is one to many and R2 is many to many. R1 has 2 attributes and R2 has 3 attributes. What is the minimum number of tables required to represent this situation in the relational model?

0 votes

Total 3 tables will be required.

1 Relation will be required for representing A. 1 will be required for B. Now since R1 is a one-to-many relationship, its attributes can be shifted to the many side(i.e. entity having total participation in this relationship).

And for many-to-many, always remember that we need another relation to represent it. This relation will consist of (primary key of A, primary key of B, attributes of R2).

1 Relation will be required for representing A. 1 will be required for B. Now since R1 is a one-to-many relationship, its attributes can be shifted to the many side(i.e. entity having total participation in this relationship).

And for many-to-many, always remember that we need another relation to represent it. This relation will consist of (primary key of A, primary key of B, attributes of R2).

- All categories
- General Aptitude 1.3k
- Engineering Mathematics 5.1k
- Digital Logic 2k
- Programming & DS 3.7k
- Algorithms 3.1k
- Theory of Computation 3.9k
- Compiler Design 1.5k
- Databases 2.9k
- CO & Architecture 2.5k
- Computer Networks 2.9k
- Non GATE 1k
- Others 1.3k
- Admissions 456
- Exam Queries 428
- Tier 1 Placement Questions 17
- Job Queries 55
- Projects 8

35,519 questions

42,843 answers

121,778 comments

42,191 users