technical skills grow

Responsive Ads Here

Sunday, January 24, 2021

How to alter column before or after in mysql table

How to add new column in table 

 I have table Student .There is three column Name Class Phone_No .Now I want to add new column ID before  Name column

ex:  Name  Class  Phone_No

I want to add new column before Name like  ID alter table using this command .

#ALTER TABLE emp ADD COLUMN ID int   BEFORE Name;

Now table structure :

Ex: Name Id  Class Phone_No 

Now we will add new column first Column in table 

#ALTER TABLE emp ADD COLUMN `id` INT NULL AUTO_INCREMENT UNIQUE FIRST;


No comments:

Post a Comment

Powered by Blogger.

Labels

Contact Form

Name

Email *

Message *

Search This Blog

Blog Archive

Ad Code

Responsive Advertisement

Recent Posts