1 / 2
文档名称:

SQL语句使用大全.docx

格式:docx   大小:10KB   页数:2页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

SQL语句使用大全.docx

上传人:bkeck 2022/1/26 文件大小:10 KB

下载得到文件列表

SQL语句使用大全.docx

文档介绍

文档介绍:SQL语句使用大全
select * from table1 where 工资>2500 and 工资〈3000
select 姓名 from table1 where 性别='男' and 工资=4000
select * froSQL语句使用大全
select * from table1 where 工资>2500 and 工资〈3000
select 姓名 from table1 where 性别='男' and 工资=4000
select * from table1 where not 工资= 3200
select * from table1 order by 工资desc //将工资按照降序排列
select * from table1 order by 工资 asc //将工资按照升序排列
select * from table1 where year(出身日期)=1987 //查询table1 中所有出身在1987的人select * from table1 where name like ’%张' /’%张%’ /’张%’ //查询1,首位字‘张’3,尾位字‘张'2,模糊查询
select * from table1 order by money desc //查询表1按照工资的降序排列表1 (升序为asc)
select * from table1 where brithday is null //查询表1 中出身日期为空的人
create bb(数据库) //创立数据库bb
create table table3 ( name varchar(10),sex varchar(2),money money, brithday datetime)//创立一个表3中有姓名,性别,工资,出身日期 (此表说明有四列)
insert into table3 values (’张三’,’男’,’2500','1989-1-5’)//在表中添加一行张三的记录
alter table table3 add tilte varchar(10) //向表3 中添加一列“title(职位)"
alter table table3 drop column sex //删除table3中‘性别’这一列
drop database aa //删除数据库aa
drop table table3 //删除表3
delete * from table3