 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we add multiple columns, with single command, to an existing MySQL table?
We can also add multiple columns to an existing table with the help of ALTER command. The syntax for it would be as follows −
Syntax
Alter table table-name ADD (column-name1 datatype, column-name2 datatype,… column-nameN datatype);
Example
In the example below, with the help of ALTER Command, columns ‘Address’, ‘Phone’ and ‘Email’ are added to the table ‘Student’.
mysql> Alter Table Student ADD(Address Varchar(25), Phone INT, Email Varchar(20)); Query OK, 5 rows affected (0.38 sec) Records: 5 Duplicates: 0 Warnings: 0
Advertisements
 