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

MySQL高阶2082-富有客户的数量

目录

题目

准备数据

分析数据


题目

编写解决方案找出 至少有一个 订单的金额 严格大于 500 的客户的数量。

准备数据

Create table If Not Exists Store (bill_id int, customer_id int, amount int)
    Truncate table Store
    insert into Store (bill_id, customer_id, amount) values ('6', '1', '549')
    insert into Store (bill_id, customer_id, amount) values ('8', '1', '834')
    insert into Store (bill_id, customer_id, amount) values ('4', '2', '394')
    insert into Store (bill_id, customer_id, amount) values ('11', '3', '657')
    insert into Store (bill_id, customer_id, amount) values ('13', '3', '257')

分析数据

select count( distinct customer_id) rich_count
from store
where amount > 500;


http://www.kler.cn/news/333565.html

相关文章:

  • Oracle SQL语句没有过滤条件,究竟是否会走索引??
  • Shell文本处理(三)
  • 古典舞在线互动:SpringBoot平台设计与功能实现
  • 鸿蒙HarmonyOS NEXT 电商APP开发,打造你的专属购物商城
  • 【算法笔记】滑动窗口算法原理深度剖析
  • Python | Leetcode Python题解之第454题四数相加II
  • FPGA实现PCIE图片采集转HDMI输出,基于XDMA中断架构,提供3套工程源码和技术支持
  • 使用LlamaIndex构建RAG
  • CTFshow 命令执行 web29~web36(正则匹配绕过)
  • 量子计算:颠覆未来计算的革命性技术
  • MySQL 启动失败 (code=exited, status=1/FAILURE) 异常解决方案
  • 手机/平板端 Wallpaper 动态壁纸文件获取及白嫖使用指南
  • CountDownlatch、CyclicBarrier、Semaphore使用介绍
  • 湖州自闭症寄宿学校:为孩子打造安全温馨的学习环境
  • SparkSQL-性能调优
  • 电脑失声,一招搞定
  • Bootstrap 4 导航栏:构建响应式和现代的网页导航
  • 【2006.07】UMLS工具——MetaMap原理深度解析
  • 21.1 k8s接口鉴权token认证和prometheus的实现
  • matlab 求绝对值