0

I have a SQL table "projects", which contains several repeated columns, example: img1, img2, img3, there are many columns in this pattern, I thought of putting a specific separator in a single cell, such as " ; ", but I don't know if it is the best option. Should I do this breakpoint, do the multiple columns patterned in sequence, or is there something better to do?

I should do like this:

img1 img2 img3 img4
asset/cover1.png asset/cover2.png asset/cover3.png asset/cover4.png
asset/cover5.png asset/cover6.png asset/cover7.png asset/cover8.png

or like this:

imgs1 imgs2
asset/cover1.png;asset/cover2.png;asset/cover3.png asset/cover4.png;asset/cover5.png;asset/cover6.png
asset/cover7.png;asset/cover8.png;asset/cover9.png asset/cover10.png;asset/cover11.png;asset/cover12.png
luan
  • 1
  • 1
  • 2
    See [here](https://stackoverflow.com/questions/2110402/sql-table-linking-is-it-better-to-have-a-linking-table-or-a-delimited-column). tl;dr it's usually better to use linking tables for many to many relationships – dc-ddfe Nov 28 '22 at 00:52
  • 2
    Neither is good, read up on relational normalisation. – Stu Nov 28 '22 at 01:00
  • Also, even though `;` is used as a possible separator instead of commas [see this](https://stackoverflow.com/questions/3653462/is-storing-a-delimited-list-in-a-database-column-really-that-bad) – Paul T. Nov 28 '22 at 01:30
  • Why are you worrying about this? Many columns in a table might be ugly and/or suboptimal, but it isn't really a problem you have to solve. – Gerballi Nov 28 '22 at 03:26

0 Answers0