From aae05c0ca8cd8e0d3c7f172f3a8de99fc0b17923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9B=84?= <3218770186@qq.com> Date: Tue, 20 Sep 2022 16:01:37 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E9=BB=84=E9=9B=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\351\273\204\351\233\204/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\351\273\204\351\233\204/.keep" diff --git "a/\351\273\204\351\233\204/.keep" "b/\351\273\204\351\233\204/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 02d54d4c40fb694f05076de0acfa6c26f6493b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9B=84?= <3218770186@qq.com> Date: Tue, 20 Sep 2022 16:02:14 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=209.19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\351\273\204\351\233\204/9.19/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\351\273\204\351\233\204/9.19/.keep" diff --git "a/\351\273\204\351\233\204/9.19/.keep" "b/\351\273\204\351\233\204/9.19/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 7332735a6e201214a7eb741681f2fa6b56289daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9B=84?= <3218770186@qq.com> Date: Tue, 20 Sep 2022 16:02:48 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E9=BB=84=E9=9B=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 榛勯泟 <3218770186@qq.com> --- "\351\273\204\351\233\204/9.19/SQLQuery2.sql" | 43 +++++++++++++++++++ ...22\345\272\217\345\207\275\346\225\260.md" | 7 +++ 2 files changed, 50 insertions(+) create mode 100644 "\351\273\204\351\233\204/9.19/SQLQuery2.sql" create mode 100644 "\351\273\204\351\233\204/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" diff --git "a/\351\273\204\351\233\204/9.19/SQLQuery2.sql" "b/\351\273\204\351\233\204/9.19/SQLQuery2.sql" new file mode 100644 index 0000000..af2fae9 --- /dev/null +++ "b/\351\273\204\351\233\204/9.19/SQLQuery2.sql" @@ -0,0 +1,43 @@ +select * from AccountInfo +select * from BankCard +select * from CardExchange +select * from CardStateChange +select * from CardTransfer +--1. 关羽的银行卡号为"6225547858741263",查询出余额比关羽多的银行卡信息,示显卡号,身份证,姓名,余额。 +select CardNo 银行卡号,AccountCode 身份证,RealName 姓名,CardMoney 余额 from AccountInfo aa +inner join (select * from BankCard where CardMoney>8000) bb on aa.AccountId=bb.AccountId + + +--2. 从所有账户信息中查询出余额最高的交易明细(存钱取钱信息)。 +select * from CardExchange +where MoneyInBank=any(select max(MoneyInBank) from CardExchange) + + +--3. 查询有取款记录的银行卡及账户信息,显示卡号,身份证,姓名,余额。 +select * from AccountInfo +where AccountId=any( +select AccountId from BankCard +where CardNo=any( +select CardNo from CardExchange +where MoneyOutBank>0 +) +) + + +--4. 查询出没有存款记录的银行卡及账户信息,显示卡号,身份证,姓名,余额。 +select * from AccountInfo +where AccountId=any( +select AccountId from BankCard where CardMoney=0) + + +--5. 关羽的银行卡号为"6225547858741263",查询当天是否有收到转账。 +select * from CardTransfer where CardNoIn ='6225547858741263' +--6. 查询出交易次数(存款取款操作)最多的银行卡账户信息,显示:卡号,身份证,姓名,余额,交易次数。 +select b.CardNo, AccountInfo .AccountCode,AccountInfo .RealName,b.CardMoney,a.cou from BankCard b +inner join (select CardNo,COUNT(*) cou,RANK() over (order by count(*) desc) sort from CardExchange group by CardNo) a on b.CardNo=a.CardNo +inner join AccountInfo on AccountInfo.AccountId=b.AccountId +where a.sort=1 +--7. 查询出没有转账交易记录的银行卡账户信息,显示卡号,身份证,姓名,余额。 +select CardNo,AccountCode,RealName,CardMoney from BankCard b +inner join AccountInfo a on a.AccountId=b.AccountId +where CardNo not in (select CardNoOut from CardTransfer) \ No newline at end of file diff --git "a/\351\273\204\351\233\204/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" "b/\351\273\204\351\233\204/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" new file mode 100644 index 0000000..523e4fd --- /dev/null +++ "b/\351\273\204\351\233\204/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" @@ -0,0 +1,7 @@ +## 鎺掑簭鍑芥暟 + 197 + 198 **鎺掑簭鍑芥暟 OVER( [鍒嗙粍瀛愬彞] 鎺掑簭瀛愬彞[DESC][ASC] )** + 199 + 200 - ROW_NUMBER()鍑芥暟鐢熸垚鐨勬帓搴忔牴鎹帓搴忓瓙鍙ョ粰鍑**閫掑杩炵画鐨勫簭鍙** + 201 - RANK()鍑芥暟鐢熸垚鐨勬帓搴忔牴鎹帓搴忓瓙鍙ョ粰鍑**閫掑鐨勫簭鍙凤紝浣嗘槸瀛樺湪骞跺垪骞朵笖璺崇┖** + 202 - DENSE_RANK() 鍑芥暟鐢熸垚鐨勬帓搴忔牴鎹帓搴忓瓙鍙ョ粰鍑**閫掑鐨勫簭鍙凤紝浣嗘槸瀛樺湪骞跺垪涓嶈烦绌** \ No newline at end of file -- Gitee From 1988938701b6d2e9399ea28d29c7ef508da4c0ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9B=84?= <3218770186@qq.com> Date: Tue, 20 Sep 2022 16:04:31 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20=E9=BB=84?= =?UTF-8?q?=E9=9B=84=20=E4=B8=BA=20=E9=BB=84=E9=9B=84123?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" => "\351\273\204\351\233\204123/.keep" | 0 .../9.19/.keep" => "\351\273\204\351\233\204123/9.19/.keep" | 0 .../9.19/SQLQuery2.sql" | 0 .../9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename "\351\273\204\351\233\204/.keep" => "\351\273\204\351\233\204123/.keep" (100%) rename "\351\273\204\351\233\204/9.19/.keep" => "\351\273\204\351\233\204123/9.19/.keep" (100%) rename "\351\273\204\351\233\204/9.19/SQLQuery2.sql" => "\351\273\204\351\233\204123/9.19/SQLQuery2.sql" (100%) rename "\351\273\204\351\233\204/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" => "\351\273\204\351\233\204123/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" (100%) diff --git "a/\351\273\204\351\233\204/.keep" "b/\351\273\204\351\233\204123/.keep" similarity index 100% rename from "\351\273\204\351\233\204/.keep" rename to "\351\273\204\351\233\204123/.keep" diff --git "a/\351\273\204\351\233\204/9.19/.keep" "b/\351\273\204\351\233\204123/9.19/.keep" similarity index 100% rename from "\351\273\204\351\233\204/9.19/.keep" rename to "\351\273\204\351\233\204123/9.19/.keep" diff --git "a/\351\273\204\351\233\204/9.19/SQLQuery2.sql" "b/\351\273\204\351\233\204123/9.19/SQLQuery2.sql" similarity index 100% rename from "\351\273\204\351\233\204/9.19/SQLQuery2.sql" rename to "\351\273\204\351\233\204123/9.19/SQLQuery2.sql" diff --git "a/\351\273\204\351\233\204/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" "b/\351\273\204\351\233\204123/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" similarity index 100% rename from "\351\273\204\351\233\204/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" rename to "\351\273\204\351\233\204123/9.19/\346\216\222\345\272\217\345\207\275\346\225\260.md" -- Gitee