The primary key contains order number and product number. Order number is the unit of transaction record and can have duplicates. Distinct count on order number is needed to get the number of distinct orders, i.e. number of transactions. So select C.
正確答案是:C: DISTINCTCOUNT(Order number)
專業(yè)分析:
在描述電商平臺上客戶的交易詳情時,訂單號(Order number)和產(chǎn)品編號(Product number)作為交易詳情表的主鍵,這意味著每一條記錄都是唯一的組合。在這種情況下,要統(tǒng)計交易次數(shù),需要確保每個訂單只被計算一次。因此,使用 DISTINCTCOUNT(Order number) 是最合適的,因為它能夠去重計算訂單號的數(shù)量,從而準確反映交易的次數(shù)。
具體分析如下:
A: COUNT(Order number) 計算訂單號的總數(shù),不去重,可能會重復計算同一個訂單的多件商品。
B: COUNT(Product number) 計算產(chǎn)品編號的總數(shù),同樣不去重,無法準確反映交易次數(shù)。
C: DISTINCTCOUNT(Order number) 去重計算訂單號的數(shù)量,能夠準確反映獨立的交易次數(shù)。
D: DISTINCTCOUNT(Product number) 去重計算產(chǎn)品編號的數(shù)量,但這并不能準確反映交易次數(shù),因為一個訂單可能包含多個不同的產(chǎn)品。
因此,選擇 C: DISTINCTCOUNT(Order number) 是最合適的。