1

I have a table of group information. Is it good to store group members in same group information table as array in a column? or should I create a separate table for group members?

I am using mysql DB, and RDBMS says to split data as much possible and so I am thinking to prefer the 2 tables option. Any suggestion?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Naik Ashwini
  • 750
  • 12
  • 32
  • 1
    Well, your question will be removed. This is not for which is best questions, but for specific issues. – Chaibi Alaa Aug 17 '16 at 08:18
  • 2
    https://en.wikipedia.org/wiki/Database_normalization – Randy Aug 17 '16 at 08:19
  • Thanx Randy. So you suggest me 2nd option. – Naik Ashwini Aug 17 '16 at 08:20
  • Yes Chaibi Alaa. But it was a prior safety I wanted to take. As it might cause many issues in later phase. This decision is important – Naik Ashwini Aug 17 '16 at 08:21
  • 1
    Yes, I would definitly split your data into different tables. For your future questions though, please use this site for programming issues (**bugs in code**). You can check out [programmers.stackexchange](http://programmers.stackexchange.com/tour) for "getting expert answers on conceptual questions about software development". – Randy Aug 17 '16 at 08:23
  • Sure Randy. Thanx a lot – Naik Ashwini Aug 17 '16 at 08:23
  • Well, it depends on their relationship. in a many to many relationship, you should use a pivot table, in a one to many relationship, you can use a relation table, or you can use a seperate table with foreign keys on second table, in a many to one relationship, you can use a .. you got the idea. if it's a one to one relationship, you can use one table or split tables. it doesn't matter much. – Taha Paksu Aug 17 '16 at 08:32
  • Yeah Taha, It will be many to many relation. One user(member) can be in many groups, and one group will have many members – Naik Ashwini Aug 17 '16 at 08:34
  • In addition, http://stackoverflow.com/a/24451701/916000 says that "you don't normalize anything by putting data into a 1:1 related separate table". – Taha Paksu Aug 17 '16 at 08:34
  • 1
    Then you "need" to split the table. This is a requirement, not a best practice. – Taha Paksu Aug 17 '16 at 08:35
  • OK Taha. Thanks I will do that – Naik Ashwini Aug 17 '16 at 08:35

0 Answers0