Sai Pone Tha Aung Sai Pone Tha Aung - 6 months ago 24
SQL Question

Mysql table replace or delete row

I don't know about how sql work. I have an image table in sql for product. Should I delete and upload new image or replace the existing row? Which is better for long term and why?

enter image description here

Answer

Well, it depends on the table purpose.

If this table is just to show each IMG_ITEM_ID path, then you don't need to save history, you can just update the old picture.

If this table should save history - To track things like old bugs, or to see what was the image in some point, the you should close the old picture, and insert a new row, but in this I advise you to add two columns - START_DATE,END_DATE which will allow you to monitor the history properly.

Comments