chebad
chebad

Reputation: 1017

Adding new column via MySQL Workbench into existing table

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

Answers (2)

Theresa Parker
Theresa Parker

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

Anad
Anad

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).

enter image description here

In the opened tab you can add or change columns (GUI is very simple and intuitive).

enter image description here

Don't forget to save changes by clicking "Apply".

Upvotes: 74

Related Questions