
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can we modify column/s of MySQL table?
By using MODIFY keyword with ALTER TABLE command we can modify the column/s of MySQL table. The syntax for the same is as follows;
Syntax
Alter table table_name MODIFY column_name1 datatype, MODIFY column_name2 datatype… MODIFY column_nameN datatype);
Example
In the example below, with the help of MODIFY keyword in ALTER Command, the size of column ‘Address’ and ‘Grade’ has been modified.
mysql> Alter table student modify address varchar(45),Modify Grade Varchar(15); Query OK, 5 rows affected (0.38 sec) Records: 5 Duplicates: 0 Warnings: 0
- Related Articles
- What can another keyword be used instead of MODIFY to modify the column/s of MySQL table?
- How can we apply BIT_LENGTH() function on the column/s of MySQL table?
- How to modify the size of column in MySQL table?
- How can we add day/s in the date stored in a column of MySQL table?
- How can we modify an existing MySQL event?
- How can we create a new MySQL table by selecting specific column/s from another existing table?
- How can we remove a column from MySQL table?
- How can I modify an existing column's data type?
- How can we put comments in a column of existing MySQL table?
- How can we use MySQL EXPORT_SET() function with column of a table?
- How can we insert current date automatically in a column of MySQL table?
- How can we change the data type of the column in MySQL table?
- How can we modify the definition of a MySQL view without dropping it?
- How MySQL CONCAT() function, applied to the column/s of a table, can be combined with the column/s of other tables?
- How can we copy data with some condition/s from existing MySQL table?

Advertisements