diff --git a/数据库系统原理与实践/平时作业/第四次作业.tex b/数据库系统原理与实践/平时作业/第四次作业.tex index e32e4fd..d9baded 100644 --- a/数据库系统原理与实践/平时作业/第四次作业.tex +++ b/数据库系统原理与实践/平时作业/第四次作业.tex @@ -198,16 +198,17 @@ from (select account.ACCOUNT_ID, OPEN_BRANCH_ID, AVAIL_BALANCE, max_avail_balanc \begin{minted}{SQL} select individual.ID_NUMBER 身份证号, concat(individual.LAST_NAME, individual.FIRST_NAME) 姓名全名 from individual -where not exists(select * - from account - where PRODUCT_CD != 'CS' and PRODUCT_CD != 'RS' and account.CUST_ID = individual.CUST_ID); +where not not exists(select * from account where PRODUCT_CD = 'CS' and account.CUST_ID = individual.CUST_ID) + and not not exists(select * from account where PRODUCT_CD = 'RS' and account.CUST_ID = individual.CUST_ID); \end{minted} \begin{csv} ,身份证号,姓名全名 -1,41032619780815564X,许文强 -2,370900196802069281,何婕 -3,320623197108259227,施珊珊 -4,321111197703197600,孔庆东 +1,350403198204222299,尤青 +2,41032619780815564X,许文强 +3,370900196802069281,何婕 +4,450881196612220768,吕东 +5,320623197806169227,严匡 +6,320623197108259227,施珊珊 \end{csv} }