3) MODIFY column in the table
The MODIFY command is used to change the column definition of the table.
Syntax:
ALTER TABLE table_name
MODIFY column_name column_definition
[ FIRST | AFTER column_name ];
Example:
In this example, we modify the column cus_surname to be a data type of varchar(50) and
force the column to allow NULL values.
Use the following query to do this:
ALTER TABLE cus_tbl
MODIFY cus_surname varchar(50) NULL;
4) DROP column in table
Syntax:
ALTER TABLE table_name
DROP COLUMN column_name;
Let's take an example to drop the column name "cus_address" from the table "cus_tbl".
Use the following query to do this:
ALTER TABLE cus_tbl
DROP COLUMN cus_address;
Continue...
Subscribe channel on YouTube
Read this post on Blogger
Like page on Facebook
Tweet about video on twitter
Let's chat on whatsapp
See you at Instagram
Google+
The MODIFY command is used to change the column definition of the table.
Syntax:
ALTER TABLE table_name
MODIFY column_name column_definition
[ FIRST | AFTER column_name ];
Example:
In this example, we modify the column cus_surname to be a data type of varchar(50) and
force the column to allow NULL values.
Use the following query to do this:
ALTER TABLE cus_tbl
MODIFY cus_surname varchar(50) NULL;
4) DROP column in table
Syntax:
ALTER TABLE table_name
DROP COLUMN column_name;
Let's take an example to drop the column name "cus_address" from the table "cus_tbl".
Use the following query to do this:
ALTER TABLE cus_tbl
DROP COLUMN cus_address;
Continue...
Subscribe channel on YouTube
Read this post on Blogger
Like page on Facebook
Tweet about video on twitter
Let's chat on whatsapp
See you at Instagram
Google+

Comments
Post a Comment