SQL

Add Column to Existing MySQL Table

By Lucas
October 20, 2012
1 min min read
Add Column to Existing MySQL Table

To add the“age” column of type “int (11)” to the“student” table, simply use the following SQL query:

ALTER TABLE aluno ADD idade int(11)

the above query will add the column“age” last column, if you want to define the position of the column use the following SQL query:

ALTER TABLE aluno ADD idade int(11) AFTER nome

The above query will add the“age” table after the“name” column.

And if you want the“age” column to be the first in the“student” table, the following instruction will satisfy you:

ALTER TABLE aluno ADD idade int(11) FIRST

 

Related Articles