mysql table commands | alter table commands | add column | drop column | rename column
Watch video to install MySQL server only
• Install mysql database | mysql serve...
Watch video to learn database commands (part-1)
• mysql database commands | mysql creat...
Add column
alter table table_nm add column column_nm varchar(10);
Add multiple columns
alter table table_nm add olumn column_nm1 varchar(10), add column column_nm2 varchar(10);
Rename column
alter table table_nm change column column_nm_old new_column_nm varchar(10);
Modify column length
alter table table_nm modify column column_nm varchar (50);
Drop column
alter table table_nm drop column column_nm;
Add Unique index
alter table table_nm add unique (column_nm);
Drop unique index
alter table table_nm drop unique column_nm;
'
Rename a table
alter table table_nm rename to new_table_nm;
Drop a table
drop table table_nm;