对库的命令
mysql> show databases 显示数据库
-> drop database abc 删除数据库 abc
-> create database abc01 创建数据库abc01
-> alter database abc01 character set gbk 修改数据库abc01字符集GBK
对表的命令
mysql> show tables 显示表
-> create table student3(id int(4),name varchar(10),age int) 创建表
-> alter table student2 rename to student02 修改studenrt2的表名为student02
-> desc student 查看表里的内容
-> drop table student3 删除
对表里的数据进行修改
mysql> alter table student add passwd int 在表中添加新的一行
-> alter table student drop math
-> alter table student change age math int 修改age的数据类型为int
-> alter table student modify math int(13) 修改age的数据类型为int
-> desc student
插入
mysql> insert into student(id,name) values(1,'tony')
-> insert into student values(2,‘tony’,123)
-> select * from student
-> select id,name from student
->
-> delete from student where id=1
->
-> update student set name=‘abc’ where id=4
查询
mysql> select * from student
-> select * from student where id=2
-> select * from student where id>2
-> select count(*) from student
-> select * from student limit 2
-> select max(id) from student
-> select min(id) from student
-> select sum(id) from student
-> select * from student order by age
-> select name,sum(age) from abc003 group by name
->
->