Thanks to visit codestin.com
Credit goes to www.tutorialspoint.com

Add Columns to an Existing MySQL Table



By using ALTER command we can add columns to an existing table.

Syntax

Alter table table-name ADD (column-name datatype);

Example

 In the example below, with the help of ALTER Command, column ‘GRADE’ is added to the table ‘Student’.

mysql> Alter table Student ADD (Grade Varchar(10));
Query OK, 5 rows affected (1.05 sec)
Records: 5 Duplicates: 0 Warnings: 0
Updated on: 2020-06-19T13:54:18+05:30

489 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements