Add Column to Existing MySQL Table

shape
shape
shape
shape
shape
shape
shape
shape

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Latest news

Latest news directly from our blog.