N:M or 1:M relationship?
1
0
Entering edit mode
5.1 years ago

Hello! I'm working on the database design of NGS pipeline focused in diagnostics. I'm working with MySQL. I created a table for the samples. At first, I thought that it would be a good idea to create a column for the index sequence used by the sequencer but the problem is that in some cases the samples have 2 indexes and this breaks the First Normal Form.

As a result, I decided to create an extra table for indexes but in this case I don't know if the relationship is N:M or 1:N considering that an index can be used for different samples in different sequencing runs and a sample can have 1 or 2 indexes or more if we consider that the samples can be sequenced twice in case of an error.

sequencing next-gen database design mysql • 714 views
ADD COMMENT
3
Entering edit mode
5.1 years ago

N:M means a many-to-many relation and 1:N means a one-to-many relation. Since a sample can have multiple indexes, the index side is N and since an index can be used for more than one sample then the sample side should be >=1 so M. So you need to represent a N:M/many-to-many relationship.

ADD COMMENT
0
Entering edit mode

I think the same but I found an example with products and two columns of colours and in that case the relationship is considered as 1:M although a colour can be present in several products.

ADD REPLY

Login before adding your answer.

Traffic: 1942 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6