当前位置:网站首页>The query that the user's test score is greater than the average score of a single subject
The query that the user's test score is greater than the average score of a single subject
2022-08-05 10:17:00 【go and be safe~】
Such a situation is often encountered in life. For example, in the grades of the whole class, we want to count the situation that each student's single subject score is above the average score of the subject in the class, and display it..
The case is as follows:
After each exam, there will be a grade sheet, as follows:
| id | job | score |
| 1 | C++ | 11001 |
| 2 | C++ | 10000 |
| 3 | C++ | 9000 |
| 4 | Java | 12000 |
| 5 | Java | 13000 |
| 6 | JS | 12000 |
| 7 | JS | 11000 |
| 8 | JS | 9999 |
| 9 | Java | 12500 |
Please write a sql statement to query the attributes of all grades whose user's score is greater than the average score of their job (job), and sort them in ascending order of id, as follows:
Incorrect spelling:
select g.id,g.job,g.score from grade g
left join
(select job,avg(score) as A from grade group by job) f
边栏推荐
- 一文道清什么是SPL
- dotnet OpenXML 解析 PPT 图表 面积图入门
- The difference between find, matches, lookingAt matching strings in matcher
- 第四章:redis 数组结构的set和一些通用命令「建议收藏」
- Getting started with Polkadot parachain development, this article is enough
- Introduction to SD NAND Flash!
- three objects are arranged in a spherical shape around the circumference
- Our Web3 Entrepreneurship Project, Yellow
- 2022华数杯数学建模思路分析交流
- 5.部署web项目到云服务器
猜你喜欢

High-quality DeFi application building guide to help developers enjoy DeFi Summer

自定义过滤器和拦截器实现ThreadLocal线程封闭

什么是CRM决策分析管理?

E-sports, convenience, efficiency, security, key words for OriginOS functions

一文道清什么是SPL

阿里顶级架构师多年总结的JVM宝典,哪里不会查哪里!

还在找网盘资源吗?快点收藏如下几个值得收藏的网盘资源搜索神器吧!

多线程(进阶) - 2.5w字总结

MySQL advanced (twenty-seven) database index principle

mysql索引
随机推荐
2022华数杯数学建模思路分析交流
Why are RELTABLESPACE values 0 for many tables displayed in sys_class?
uniapp connect ibeacon
The technological achievements of Shanghai Konan were selected into the "2021 Shanghai Network Security Industry Innovation Research Achievement Catalog" by the Municipal Commission of Economy and Inf
Imitation SBUS fixed with serial data conversion
你最隐秘的性格在哪?
leetcode: 529. Minesweeper Game
第五章:activiti流程分流判断,判断走不同的任务节点
Tanabata romantic date without overtime, RPA robot helps you get the job done
STM32+ULN2003驱动28BYJ4步进电机(根据圈数正转、反转)
Four years of weight loss record
创建一个 Dapp,为什么要选择波卡?
IDEA performs the Test operation, resulting in duplicate data when data is inserted
static linking and dynamic linking
QSS 选择器
2022杭电多校 第6场 1008.Shinobu Loves Segment Tree 规律题
攻防世界-PWN-new_easypwn
告白数字化转型时代:麦聪软件以最简单的方式让企业把数据用起来
Development common manual link sharing
牛刀小试基本语法,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang基本语法和变量的使用EP02