mysql 增删改查
登录到数据
mysql -u root
创建数据库
create database test4;
选择数据库
use test4;
创建表
create table stu(id int unsigned not null auto_increment primar
y key,age tinyint unsigned not null,phone char(13) null default "000" );
增
insert into stu values(null,16,130769488);
删
delete from stu ;
改
update stu set age =222 where phone="130769488";
查
select * from stu;
修改表
修改列
alter table stu change phone tel char(13);
增加列
alter table stu add addr char;
删除列
alter table stu drop tel;
重命名表
alter table stu rename student;
删除表
drop table student;
删除数据库
drop database test4;
更多资料
mysql官方文档