当前位置:网站首页>True MySQL interview question (21) - Finance - overdue loan
True MySQL interview question (21) - Finance - overdue loan
2022-06-23 05:48:00 【Socialphobia_ FOGO】
The loan is overdue
A financial loan company , You need to know about the overdue loans of users . There is a user in the company's database " Loan overdue days " surface .
When overdue days =0 when , Write it down as M0,
Overdue days in [1,30] In the interval , Write it down as M1,
Overdue days in [31,60] In the interval , Write it down as M2,
Overdue days in [61,90] In the interval , Write it down as M3,
Other higher overdue days are recorded as M4+,
Now we need to analyze each overdue period in the database (M0、M1、M2、M3、M4+) Number of orders , If it's you , How will it be analyzed ?
give the result as follows :
SELECT
SUM(CASE WHEN Days overdue =0 THEN 1 ELSE 0 END) AS M0,
SUM(CASE WHEN Days overdue BETWEEN 1 AND 30 THEN 1 ELSE 0 END) AS M1,
SUM(CASE WHEN Days overdue BETWEEN 31 AND 60 THEN 1 ELSE 0 END) AS M2,
SUM(CASE WHEN Days overdue BETWEEN 61 AND 90 THEN 1 ELSE 0 END) AS M3,
SUM(CASE WHEN Days overdue >90 THEN 1 ELSE 0 END) AS M4
FROM Loan overdue days
边栏推荐
- vant weapp日历组件性能优化 Calendar 日历添加min-date最小日期页面加载缓慢
- Win11如何开启移动热点?Win11开启移动热点的方法
- visdom的使用
- C primer plus学习笔记 —— 2、常量与格式化IO(输入/输出)
- Huawei's software and hardware ecosystem has taken shape, fundamentally changing the leading position of the United States in the software and hardware system
- AHA C language Chapter 7 you can do more with it (talks 27-28)
- 高等数学(第七版)同济大学 习题1-8 个人解答
- ArcTime 制作中英文字幕视频
- 104. simple chat room 7: use socket to transfer objects
- Current situation and development of containerization technology under the cloud native trend
猜你喜欢

True question of MySQL interview (29) -- case - finding favorite movies

Activity启动模式和生命周期实测结果

Wechat applet; AI intelligent dubbing assistant

华为软硬件生态圈成型,从根子上改变美国对软硬件体系的领导地位

Is there a real part-time job online? How do college students find part-time jobs in summer?

Special research on Intelligent upgrading of heavy trucks in China in 2022

【owt】owt-client-native-p2p-e2e-test vs2017构建 6:修改脚本自动生成vs工程

iNFTnews | 加密之家从宇宙寄来的明信片,你会收到哪一张?

FS2119A同步升压IC输出3.3V和FS2119B同步升压IC输出5V

Heimdall Database Proxy横向扩展提高20倍
随机推荐
iNFTnews | 加密之家从宇宙寄来的明信片,你会收到哪一张?
How can digital collections empower economic entities?
Oracle exception
高等数学(第七版)同济大学 习题1-7 个人解答
Activity启动模式和生命周期实测结果
【owt】owt-client-native-p2p-e2e-test vs2017构建 6:修改脚本自动生成vs工程
[graduation season u; advanced technology Er] farewell to the confused self in the past two years. Regroup, junior I'm coming
移动电源快充QC3.0方案芯片IP5318快充方案
【数据库备份】通过定时任务完成MySQL数据库的备份
The performance of nonstandard sprintf code in different platforms
雷达图canvas
Management system of borrowed books based on SSM framework
【斯坦福计网CS144项目】Lab2: TCPReceiver
@jsonfield annotation in fastjson
Build a gocd environment
数字藏品如何赋能经济实体?
What benefits have digital collections enabled the real industry to release?
Wechat applet; AI intelligent dubbing assistant
Wechat applet: elderly blessing short video
jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定