模糊查询:

like 运算符

通配符:%——代表0-n个任意字符

- ——代表单个任意字符

注意:只有char、varchar、text类型才能使用

例子:

select * from student where name like '刘%'

select * from student where name like '%建%'

select * from student where name like '%娟'

聚合函数:对数据库中数据进行统计计算并给出结果

sum max/min avg count

例子:1.求语文课总成绩

2.求语文课的最高分和最低分

3.求语文课的平均成绩

4.求语文课考试记录条数

select sum(exam) as 语文课总成绩 from exam where subjectID=1;

select max(exam) as 语文课最高分 min(exam) as 语文课最低分 from exam where subjectID=1;

select avg(exam) as 语文课平均分 from exam where subjectID=1;

select count (exam) as 数学成绩记录数 from exam where subjectID=1;

技术
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信