当前位置: 首页 > news >正文

ai做网站步骤做招聘网站多少钱

ai做网站步骤,做招聘网站多少钱,优化大师软件下载,电子商务网站建设及其相关法律问题DQL数据查询语言 从数据表中提取满足特定条件的记录 1.单表查询 2.多表查询 查询基础语法 select 关键字后指定要查询到的记录的哪些列 语法:select 列名(字段名)/某几列/全部列 from 表名 [具体条件]; select colnumName…

DQL数据查询语言

从数据表中提取满足特定条件的记录

1.单表查询

2.多表查询

查询基础语法

select 关键字后指定要查询到的记录的哪些列

语法:select  列名(字段名)/某几列/全部列 from 表名 [具体条件];

select colnumName1[colnumName2...] from <tableName> [where conditions];

select colnumName1[colnumName2...] from <tableName> [where conditions];

如果要显示查询到的记录的所有列,则可以使用 * 替代字段名列表(项目开发中不建议使用*)

select * from stus;

select * from stus;

  总结: 

29177cfc4d46403f878cfc036512155c.png

 

 条件关系运算符

b5a9062903844da9ae7a63d513a65588.png

示例1: 增删改操作

cb5d98fbc83941caa840fa950e748708.png

示例2:查询表中某一列

e3374f84b6ba4341b596091c845085a0.png

示例3:select * 查询表中所有列;

a8869d8b5ea44db49b922ec2913acc1e.png

 示例4:select * 表名 where 列名 + 限制条件 查询表中满足条件的所有数据项

查询表中time >= 20021104的数据

cca3c860a8984052b686e5bf0c84ec52.png

完整示例:查询时间为20210723的数据:fb30073fb1d14a80a99cd55956642630.png 

区间查询

select * from rebirth where 列名  between 数据项1 and 数据项2;

between 查询期间的开始 and 查询期间的结束

885861abcef147c0b855d0733346b796.png

 条件逻辑运算符

在where子句中,可以将多个条件通过逻辑运算(and:并且\or:或者\not:取反)进行拼接,通过多个条件来筛选要操作的数据。

162e23ba68b1478d96d4cb0806aaef20.png

and:并且:ac46495d81e4448c92c489c0bbbacb0a.png

or:或者:

fa221c1d36a64877bfe23efa847ac550.pngnot:取反:

a7532b30346444ebb3bb44082c66a884.png

 DQL数据查询语言 模糊查询

LIKE子句

在where子句的条件中,我们可以使用like关键字来实现模糊查询

1842924ce02e405c98d82386b31c388b.png

语法

select * from 表名 where 列名 like '模糊查询的关键字 是否包括o类似如此'

select * from 表名 where 列名 like '%模糊查询条件%'

select * from 表名 where 列名 like   '%o%';          查询包含字母o的数据项

select from 表名 where 列名 like '_o%';                查询第二个字母是o的数据项

64339467805e4701bffd1f2f71540dc6.png

ad71f2c78dc94322a432db5ea31450fe.png

 'x%' 查询首字符为x的数据项

fbecfae764964b289819fabd2172e362.png

‘%x' 查询最后一个字符为x的数据项

2a204836d5644a5eb5d3ca773aa7ffdc.png

 对查询结果的处理

1.设置查询的列

声明显示查询结果的指定列

3f8c5365e5614610a0db8eecaab73f7a.png

select 列名...from 表名 where 符合查询结果;

9204824172a441b48d5c1c91ee7f475c.png

 select 列名1,列名2 from 表名;

查询所有查询列中数据

4f870670d8f14c53818dca0d10b286a2.png

计算列

select 列名,某数值-列名 from 表名;

04f8dca932eb44c690a1816244926edb.png

as关键字 字段取别名 修改列名

select 列名,某数值吧-列名 as 别名 from 表名;

7cec2ed1e31e467caedb6acc186a11a2.png

792035d1ef004851a624260a79216c6a.png

查询表中某列的所有数据

select 列名 from 表名;

e2723128f2a445b79879ce250681d660.png

select distinct 列名 from 表名;

distinct 去重关键字 去除重复的数据

a90fe7caad6c48ed96dcf52e605e4b81.png

2.查询排序结果

排序:order by

将查询到的满足条件的记录按照指定的列的值升序/降序排列

select * from 表名 where 条件 order by 列名 升序/降序

081a20280a03453ba8cfdd32143c02a2.png

升序排序: 

3af945e56ca7412f84b045d71579b194.png

 降序排序:

dbc8a8df828b4b7c87cac63429941ef8.png

字段排序

4d4aca330fb84bca8bbee1f35218db89.png

单字段排序 

b445fb11e7d54d998c5eaa88e3a7dff1.png 多字段排序

e564a53e4c154872a1d93193bb660a4d.png

总结 

#10.25#选择使用数据库
use fine;#创建数据表
create table rebirth(rebirth_name varchar(10) primary key,rebirth_happen varchar(20) not null,rebirth_time int(8) not null,rebirth_mood varchar(10),rebirth_go varchar(15) not null
);#查询某表中所有列
select * from rebirth;#删除某项表
drop table if exists rebirth;#添加表数据
insert into rebirth(rebirth_name,rebirth_happen,rebirth_time,rebirth_mood,rebirth_go
)values('lcl','意外',20210723,'pain','insist'
);insert into rebirth(rebirth_name,rebirth_happen,rebirth_time,rebirth_mood,rebirth_go
)values('lyc','意外',20230904,'pain','hard'
);# 查询表中日期为20210723的数据
select * from rebirth where rebirth_time = 20210723;#查询表中mood为pain的数据
select * from rebirth where rebirth_mood = 'pain';#查询表中go为hard的数据
select * from rebirth where rebirth_go != 'hard';#查询表中time >= 20021104的数据
select * from rebirth where rebirth_time >= 20021104;#查询time >= 11111111, <= 99999999的数据
select * from rebirth where rebirth_time between 11111111 and 99999999; #查询rebirth_happen='意外'且rebirth_mood='pain'
select * from rebirth where rebirth_happen='意外' and rebirth_mood='pain';#查询rebirth_go='hard'或rebirth_name='lcl'
select * from rebirth where rebirth_go='hard' or rebirth_name='lcl';#查询rebirth_name=‘lcl';
select * from rebirth where not rebirth_name = 'lcl';#查询rebirth_name中存在字符l的数据项
select * from rebirth where rebirth_name like '%l%';#查询rebirth_happen中第二个字符是外
select * from rebirth where rebirth_happen like '_外%';#查询rebirth_name中最后一个字符是c
select * from rebirth where rebirth_name like '%c';#查询rebirth_name中第一个字符是l
select * from rebirth where rebirth_name like 'l%';#查询rebirth_name中第一个字符是l的数据的rebirth_name和rebirth_go两列
select rebirth_name,rebirth_go from rebirth where rebirth_name like 'l%';#查询rebirth列中rebirth_name和20231025-rebirth_time的列
select rebirth_name,20231025-rebirth_time from rebirth; #修改列名
select rebirth_name as 重生日,20231025-rebirth_time as 车祸日 from rebirth; #查询某表中的某一列
select rebirth_go from rebirth;#查询莫表中的某一列,去除重复的项
select distinct rebirth_name from rebirth;#查询莫表中的某一列,去除重复的项
select distinct rebirth_happen from rebirth;#查询排序数据结果 排序order by asc升序 desc降序 单字段排序
select * from rebirth where rebirth_time order by rebirth_time asc;#查询排序数据结果 排序order by asc升序 desc降序 单字段排序
select * from rebirth where rebirth_time order by rebirth_time desc;#查询排序数据结果 排序order by asc升序 desc降序 双排序排序
select * from rebirth where rebirth_time order by rebirth_go asc,rebirth_mood desc;#查询rebirth表
select * from rebirth ;

 

 

http://www.yayakq.cn/news/357430/

相关文章:

  • 秦皇岛网站团队石景山做网站的公司
  • 网站首页成品建立网站数据库实验报告
  • 一个正规的网站建设公司做网站怎么带流量
  • 网站建设流程发布网站和网页制作WordPress个人主页404
  • 做调查可以赚钱的网站源码网站 怎么做
  • 网站开发职责与要求电商外贸平台有哪些
  • 贵州网站开发哪家便宜教育网站制作哪专业
  • 天津建设银行网站首页驻马店公司做网站
  • 个人做众筹网站合法吗域名ip地址查询
  • 网站建设工具最简洁的铜陵网站建设推广
  • 建设网站需要哪些编程怎么建立自己的微信公众号
  • vuejs 可做网站吗建筑网片价格
  • 昆明网站建设优化下沙做网站的公司
  • 求做网站的哪些网站可以做外链
  • 服务器租用网站模版vi设计公司模板
  • 单页网站制作市场营销策划方案格式模板
  • 成都龙华小学网站建设一流的龙岗网站制作
  • wap网站一览公司微信网站建设方案模板
  • 南昌做网站哪家最好郑州微信小程序开发公司排名
  • 成品网站w灬源码伊甸3m8u帝国cms关闭网站
  • 项目建设情况网站排名优化机构
  • 住房城乡建设干部学院网站国外的app设计网站
  • 有口碑的常州网站优化网站 建设需要提供哪些资料
  • 医院网站建设策划案模板免费找精准客户软件
  • python做的网站如何部署wordpress+浮动播放器
  • 保定网站seo技术成都网站建设电话咨询
  • 和田地区建设局网站教育加盟网站建设
  • 聚诚网站建设山水人家装饰公司
  • 彩票网站为啥链接做两次跳转wordpress如何在页首添加登录账号
  • 现在建设一个基础的网站多少钱免费的网站后台管理系统