当前位置:网站首页>MySQL creates a student table and queries grades
MySQL creates a student table and queries grades
2022-07-27 18:07:00 【Lush grass on the plains 77】
Create table
CREATE TABLE testdb.users (
`userid` INT(20) PRIMARY KEY NOT NULL AUTO_INCREMENT,
`username` VARCHAR(20) NOT NULL,
`sex` CHAR (3) DEFAULT NULL,
`age` INT (3) DEFAULT NULL,
`num` BIGINT (200) DEFAULT NULL
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;Query table data
1, Query the total score of men and women
SELECT sex, sum(num) FROM testdb.users GROUP BY sex;2, Query the basic information of each user , Fraction in 90 For excellence ,[80,60) For good , Less than 60 For failing .
select
userid ,
username,
case
when num >90 then ' good '
when num <80
and num>60 then ' good '
else ' other '
end as ' achievement '
from
testdb.users u
边栏推荐
- Mlx90640 infrared thermal imager temperature sensor module development notes (VII)
- 2022 high altitude installation, maintenance and removal of test question simulation test platform operation
- MLX90640 红外热成像仪测温传感器模块开发笔记(七)
- Taishan Office Technology Lecture: word strange paragraph borders
- Activate genuine win7 ultimate system with slmgr command
- 知物由学 | 再造巴别塔,我们如何进行NLP跨语言知识迁移?
- JS to realize the right-click menu bar function
- How can we carry out NLP cross language knowledge transfer?
- JDBC connection database reading foreground cannot display data
- 7月第4周易盾业务风控关注 | 最高法对APP强索个人信息进行规制
猜你喜欢

灵魂一问:为什么ES比MySQL更适合复杂条件搜索?

知物由学 | 易盾移动端同构实践,几步改善官网交互体验
![[user article] examples of P4 consolidation practice guide disassemble resolve](/img/84/503fc057ce642038f693b38be69bc0.png)
[user article] examples of P4 consolidation practice guide disassemble resolve

知物由学 | 再造巴别塔,我们如何进行NLP跨语言知识迁移?

Branch loop statement of C language

卷积神经网络——FPN(Feature Pyramid Networks)介绍

Original direct selling MOS tube knl42150 2.8a/1500v applicable photovoltaic inverter can provide samples
![[MCU] 2.2 pin function of AT89S52](/img/d0/b204efb80ec5f0b7bc2d83d0250eb9.png)
[MCU] 2.2 pin function of AT89S52

笔试缺考者入围教师招聘面试?河南祥符:个别考生成绩统计错误

numpy数组矩阵操作
随机推荐
Activate genuine win7 ultimate system with slmgr command
JS to realize the right-click menu bar function
C语言怎么学?这篇文章给你完整答案
知物由学 | 关联图分析在反作弊业务中的应用
Evaluation index of machine learning (I) -- regression evaluation index
卷积神经网络之卷积计算过程个人理解
树莓派驱动代码的编译和测试
机器学习——概念理解之IoU
卷积神经网络——YOLOV2(YOLO9000)论文翻译
Understand JVM language
微信小程序 云函数批量删除多条数据 Error: errCode: -502005 database collection not exists
hutool 字符串工具类
Soul 1: why is es more suitable for complex condition search than MySQL?
Numpy array matrix operation
知物由学 | APP大瘦身,新一代AAB框架下的安全加固之道
Yyds dry inventory interview must brush top101: specified interval reversal in the linked list
In the first week of June, risk control of e-shield business paid attention to 15 institutions such as New Oriental XRS, which were fined
快解析结合华途文档加密软件
golang 并发缓存击穿或合并请求
The whole process of neural network construction is finally completed! Can't you come to me~