SQL Server第五章-聚合函数在查询中的使用(头歌)答案代码

第1关:AVG() 函数的使用

sql 复制代码
select prod_name,prod_price

from Products

where prod_price>(select AVG(prod_price)  from Products)

16第2关:COUNT() 函数的使用

sql 复制代码
select count(*)

from Products

where prod_price>18

17.第3关:MAX() 函数和 MIN() 函数的使用

sql 复制代码
select prod_name,prod_price from Products

where prod_price:(select min(prod_price)from Products)

18第4关:SUM() 函数的使用

sql 复制代码
select sum(prod_price*quantity)as amount

from Products

声明:著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

相关推荐
得物技术3 小时前
MySQL单表为何别超2000万行?揭秘B+树与16KB页的生死博弈|得物技术
数据库·后端·mysql
可涵不会debug7 小时前
【IoTDB】时序数据库选型指南:工业大数据场景下的技术突围
数据库·时序数据库
ByteBlossom7 小时前
MySQL 面试场景题之如何处理 BLOB 和CLOB 数据类型?
数据库·mysql·面试
麦兜*7 小时前
MongoDB Atlas 云数据库实战:从零搭建全球多节点集群
java·数据库·spring boot·mongodb·spring·spring cloud
Slaughter信仰7 小时前
深入理解Java虚拟机:JVM高级特性与最佳实践(第3版)第十章知识点问答(10题)
java·jvm·数据库
麦兜*7 小时前
MongoDB 在物联网(IoT)中的应用:海量时序数据处理方案
java·数据库·spring boot·物联网·mongodb·spring
-Xie-8 小时前
Mysql杂志(十六)——缓存池
数据库·mysql·缓存
七夜zippoe8 小时前
缓存与数据库一致性实战手册:从故障修复到架构演进
数据库·缓存·架构