trinth
trinth

Reputation: 6047

How to achieve multiple relations per database column in a RDBMS

I have a table A with column, 'properties'. I have another table B with columns name, description. Is there any way in a RDBMS to have a schema where A.properties can point to multiple records in table B? For example:

A.properties --> [<B instance#1>, <B instance#2>, ...]

Can this be done? Is there a conventional and/or elegant way to do it?

I don't want to resort to NoSQL if I don't have to...and even then from what I've read, it is not possible to have relations in NoSQL (at least for MongoDB).

Upvotes: 0

Views: 93

Answers (1)

James Scriven
James Scriven

Reputation: 8154

Yes, this is quite normal. One way would be to put the primary key of A in a column in B. The other way is to create a third, 'linking' table that links A with multiple Bs.

Upvotes: 2

Related Questions