skip to Main Content

Basically I need to add a new column to a table. I need to call that column category and in that column of Category I want the default value to be the name of that new category column I will add.

How can I do this inside of phpmyadmin by command?

I have about 100 tables and each table has 100+ items, which is why I need to do it with a command rather than manually adding the column and the name.

Thanks

2

Answers


  1. Try this:

    alter table test.Name add NewCol varchar(10) NOT NULL DEFAULT 'new val'
    

    It should helps.

    Login or Signup to reply.
  2. Add new column in a exsisting table with default value:-

    ALTER TABLE table_name
    ADD new_col_name VARCHAR(50) DEFAULT 'new value' NOT NULL;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search