1、 创建数据库:CreateDATABASEdatabase-name
2、 删除数据库:drop database dbname
3、 创建新表:create table tablename
4、 删除新表:drop table tabname
5、 增加一个列:Alter table tabname add column col type
6、 添加主键: Alter table tabname add primary key(col)
7、 删除主键: Alter table tabname drop primary key(col)
8、 创建索引:create [unique] index idxname on tabname 删除索引:drop index idxname
9、 查询:select * from table1 where 范围查找:select * from table1 where field1 like ’%value1__’
10、 插入:insert into table1(field1,field2) values(value1,value2)
11、 删除:delete from table1 where 范围
12、 更新:update table1 set field1=value1 where 范围
13、 排序:select * from table1 order by field1,field2 [desc]
14、 总数:select count * as totalcount from table1
15、 求和:select sum(field1) as sumvalue from table
16、 平均:select avg(field1) as avgvalue from table1
17、 最大:select max(field1) as maxvalue from table
18、 最小:select min(field1) as minvalue from table1