当前位置:网站首页>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
边栏推荐
- 英集芯IP5566带TYPE-C口3A充放快充移动电源5w无线充二合一方案SOC
- MySQL面试真题(三十)——贝壳-房产订单分析
- Opportunities and challenges of digital collections from the perspective of technology development team
- The digital collection market has just begun
- Fs2119a Synchronous Boost IC output 3.3V and fs2119b Synchronous Boost IC output 5V
- 知识点滴 - 折叠锻打和大马士革钢
- The author believes that the so-called industrial Internet is a process of deep integration of industry and the Internet
- Special research on Intelligent upgrading of heavy trucks in China in 2022
- Wechat applet: Star Trek spaceship ticket production and generation
- Composite API
猜你喜欢

How can digital collections empower economic entities?

高等数学(第七版)同济大学 习题1-8 个人解答

What does the English letter PC mean? What does the Internet PC mean

The 510000 prize pool invites you to participate in the competition -- the second Alibaba cloud ECS cloudbuild developer competition is coming

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

数字藏品火热背后需要强大的技术团队支持 北方技术团队

visdom画多条动态损失曲线

阿里云对象存储oss+picgo+typora实现构建图床

Arctime makes Chinese and English subtitle video

华为软硬件生态圈成型,从根子上改变美国对软硬件体系的领导地位
随机推荐
Shifu, the open source development platform of the Internet of things, is open for internal testing! Release of the first version of technical documents
Common wireless charging and transmitting IC chips
PAT 乙等 1016 C语言
Redis cache penetration solution - bloom filter
AI艺术的基因工程?使用 #Artbreeder 改变图像的任意形态
PAT 乙等 1015 C语言
[image fusion] sparse regularization based on non convex penalty to realize image fusion with matlab code
PAT 乙等 1022 D进制的A+B
Oracle异常
June 22, 2022: golang multiple choice question, what does the following golang code output? A:3; B:1; C:4; D: Compilation failed. package main import ( “fmt“ ) func mai
高等数学(第七版)同济大学 习题1-8 个人解答
MySQL Foundation
Heimdall Database Proxy横向扩展提高20倍
PAT 乙等 1026 程序运行时间
Yingjixin launched 4 series of lithium batteries 100W mobile power supply voltage rise and fall scheme SOC chip ip5389
Build a gocd environment
Yingjixin ip5566 with type-C port 3A charging and discharging fast charging mobile power supply 5W wireless charging in one SOC
Heimdall database proxy scale out 20 times
GDB data reading in GDAL (III) of GIS
高等数学(第七版)同济大学 习题1-9 个人解答