shash_bro

asked on

# How to model 3 relationships into one table

Hi All

I have a situation where there are two tables - Table A (a1 (PK)) and Table B (b1 (PK)) .

I have business requirement to have the following relationships between the two tables.

1) Many to Many relationship from A to A

2) One to Many from B to A

3) One to One from B to B

Please let me know how can I model the best way.

Also, I was trying to model the 3 relationships into one table cause the relationships have common attributes like start, end dates and codes. Please let me know if it is possible to model the above 3 relationships in one single table, and how?

I have a situation where there are two tables - Table A (a1 (PK)) and Table B (b1 (PK)) .

I have business requirement to have the following relationships between the two tables.

1) Many to Many relationship from A to A

2) One to Many from B to A

3) One to One from B to B

Please let me know how can I model the best way.

Also, I was trying to model the 3 relationships into one table cause the relationships have common attributes like start, end dates and codes. Please let me know if it is possible to model the above 3 relationships in one single table, and how?

What exactly are you looking for? An example of the graphical representation of a data model? Or SQL code examples for each one of your requirements?

ASKER

Graphical would be cool but if you can just indicate the foreign keys in the table description that's good. Thx much

ASKER CERTIFIED SOLUTION

membership

Create a free account to see this answer

Signing up is free and takes 30 seconds.

**No credit card required.**ASKER

ScottPlecher:

You haven't indicated the relationship 1to1 from B to B?

You haven't indicated the relationship 1to1 from B to B?

SOLUTION

membership

Create a free account to see this answer

Signing up is free and takes 30 seconds.

**No credit card required.**ASKER

Thanks much