数据库系统原理与实践——修复第四次作业中的错误

之前的代码的含义变成了“在2011、2019年等有交易记录”这个应该是错误的意思了,现在改正了。
This commit is contained in:
423A35C7 2024-10-20 18:40:33 +08:00
parent 0a60c93ef6
commit 527b98f61b

View File

@ -230,32 +230,35 @@ where not not exists(select * from account where PRODUCT_CD = 'CS' and account.C
其他年无交易记录,不要,要 其他年无交易记录,不要,要
\end{csv} \end{csv}
\begin{minted}{SQL} \begin{minted}{SQL}
select ACCOUNT_ID select account.ACCOUNT_ID
from account from account
left join (select * left join (select ACCOUNT_ID
from acc_transaction from acc_transaction
where year(TXN_DATE) != 2013) as not2013 using (ACCOUNT_ID) where year(TXN_DATE) = 2013) as _2013 on account.ACCOUNT_ID = _2013.ACCOUNT_ID
where TXN_DATE is not null; where _2013.ACCOUNT_ID is null
order by account.ACCOUNT_ID;
\end{minted} \end{minted}
\begin{csv} \small\begin{csv}
,ACCOUNT_ID ,ACCOUNT_ID
1,4 1,1
2,5 2,2
3,18 3,3
4,19 4,5
5,21 5,10
6,28 6,11
7,10 7,12
8,17 8,13
9,13 9,15
10,29 10,17
11,27 11,18
12,3 12,19
13,23 13,21
14,12 14,22
15,22 15,23
16,15 16,27
17,28 17,28
18,29
19,30
\end{csv} \end{csv}
} }
\questionandanswer[]{ \questionandanswer[]{