创建/删除 数据库
create/drop database databasebname
创建/删除 视图
create/drop view viewname (c1,c2...) as select c1,c2... from tablename where...
创建表
create table tablename (
c1 int(10) not null primary key
c2 char(10) default "xx"
c3 varchar(10)
c4 date(yyyymmdd)
c5 decimal(10,3)
)
删除表
drop table tablename
创建索引
alter table tablename add index indexname(c1)
删除索引
drop index indexname
增
insert into tablename (c1,c2...) values (v1,v2...)
删
delete from tablename where...
改
update tablename set c1=v1,c2=v2... where...
查
select distinct table1.c1 as newc1, table2.c2 as newc2
from tabel1, table2
where table1.c1 not like 'x%' and/or table2.c2 in/not in(v1,v2...)
group by table1.c1
order by table2.c2 desc/asc
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交