Show database or table:
Show databases;//Then you can use database_name;
Show tables;
Change table name:
Alter table table_name rename new_t;
Add column:
Alter table table_name add column c_n column attributes;
Delete column:
Alter table table_name drop column c_n;
Create index:
Alter table c_table add index (c_n1,c_n2);
Alter table c_table add unique index_name(c_n);
Alter table c_table add primary key(sid);
Delete index:
Alter table c_table drop index c_n1;
Change column information:
Alter table t_table change c_1 c_1 varchar(200);
Alter table t_table modify 1 c_1 varchar(200);
insert statement:
Insert into table_name (c_1,c_2)
values (’x1’,1);
update statement:
Update table_name set c_1 =1 where c_2=3;
Delete database or table:
Drop table table_name;
Drop database database_name;//Can be deleted using mysql_drop_db().