Reputation: 1017
I have existing table which is called person
, I want to add via MySQL Workbench new column into it, for example column age
. How can I manage this operation using this program, where and what I need to write?
I found query like this, should it works?
ALTER TABLE person ADD age INT(3);
Upvotes: 27
Views: 61211
Reputation: 13
I don't know if you have your answer, I know this thread is very old but in case someone else is looking, I just learned how to do this myself:
The syntax is:
ALTER TABLE person ADD COLUMN age INT;
Always list the datatype after the new column name. I hope this helps.
Upvotes: 0
Reputation: 918
I don't know if Stackoverflow is proper place to such question, but...
Click on the table you want to change (using right mouse button) and choose "Alter table" (schemas and tables lists are on the left).
In the opened tab you can add or change columns (GUI is very simple and intuitive).
Don't forget to save changes by clicking "Apply".
Upvotes: 74