当前位置:网站首页>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
边栏推荐
- leetcode: 529. 扫雷游戏
- Four years of weight loss record
- static linking and dynamic linking
- [Strong Net Cup 2022] WP-UM
- 什么是CRM决策分析管理?
- What is the function of the regular expression replaceFirst() method?
- 2022华数杯数学建模思路分析交流
- Development common manual link sharing
- EU | Horizon 2020 ENSEMBLE: D2.13 SOTIF Safety Concept (Part 2)
- 七夕浪漫约会不加班,RPA机器人帮你搞定工作
猜你喜欢

egg框架使用(一)

数据中台建设(十):数据安全管理

Still looking for a network backup resources?Hurry up to collect the following network backup resource search artifact it is worth collecting!

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

three objects are arranged in a spherical shape around the circumference

leetcode: 529. Minesweeper Game

【 temperature warning program DE development 】 event driven model instance

Custom filters and interceptors implement ThreadLocal thread closure

Keil升级到AC6后,到底有哪些变化?

偏向锁/轻量锁/重级锁锁锁更健康,上锁解锁到底是怎么完成实现的
随机推荐
19. Server-side session technology Session
Pycharm 常用外部工具
Create a Dapp, why choose Polkadot?
uniapp 连接ibeacon
Huawei's lightweight neural network architecture GhostNet has been upgraded again, and G-GhostNet (IJCV22) has shown its talents on the GPU
正则表达式replaceAll()方法具有什么功能呢?
2022 Huashu Cup Mathematical Modeling Ideas Analysis and Exchange
js劫持数组push方法
Analysis and practice of antjian webshell dynamic encrypted connection
【AGC】增长服务1-远程配置示例
创建一个 Dapp,为什么要选择波卡?
static linking and dynamic linking
EU | Horizon 2020 ENSEMBLE: D2.13 SOTIF Safety Concept (Part 2)
LeetCode 216. Combined Sum III (2022.08.04)
[Strong Net Cup 2022] WP-UM
dotnet OpenXML parsing PPT charts Getting started with area charts
RT-Thread记录(一、RT-Thread 版本、RT-Thread Studio开发环境 及 配合CubeMX开发快速上手)
牛刀小试基本语法,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang基本语法和变量的使用EP02
Oracle temporary table space role
首次去中心化抢劫?近2亿美元损失:跨链桥Nomad 被攻击事件分析