what is better to remove a column or make it null in MySQL.
Mohammed Samgan Khan

Mohammed Samgan Khan @msamgan

About: Love to code with a DRY KISS

Location:
USA
Joined:
Apr 23, 2019

what is better to remove a column or make it null in MySQL.

Publish Date: Jul 13 '19
8 4

hi,

I am a bit confused, should I delete a column as the data in that col is not in use in the system or make it null so that the old data remains.

what's the better approach?

Comments 4 total

  • rhymes
    rhymesJul 13, 2019

    If you are sure you don't need the data, do a backup and then drop the column

  • Pankaj
    PankajJul 13, 2019

    Agreed with rhymes. If you think you might need the data then keep/backup it otherwise remove the column. There is no point in keeping something that you won't use ever.

Add comment