考试报名
考试报名
考试内容
考试大纲
在线客服
返回顶部

备考刷题,请到

CDA认证小程序

When describing the transaction details of customers on an e-commerce platform, with order number + product number as the primary key in the transaction details table, which measure should be used to get the number of transactions?
A. COUNT(Order number)
B. COUNT(Product number)
C. DISTINCTCOUNT(Order number)
D. DISTINCTCOUNT(Product number)
上一题
下一题
收藏
点赞
评论
题目解析
题目评论(0)

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)

专业分析:
在描述电商平台上客户的交易详情时,订单号(Order number)和产品编号(Product number)作为交易详情表的主键,这意味着每一条记录都是唯一的组合。在这种情况下,要统计交易次数,需要确保每个订单只被计算一次。因此,使用 DISTINCTCOUNT(Order number) 是最合适的,因为它能够去重计算订单号的数量,从而准确反映交易的次数。

具体分析如下:

A: COUNT(Order number) 计算订单号的总数,不去重,可能会重复计算同一个订单的多件商品。

B: COUNT(Product number) 计算产品编号的总数,同样不去重,无法准确反映交易次数。

C: DISTINCTCOUNT(Order number) 去重计算订单号的数量,能够准确反映独立的交易次数。

D: DISTINCTCOUNT(Product number) 去重计算产品编号的数量,但这并不能准确反映交易次数,因为一个订单可能包含多个不同的产品。

因此,选择 C: DISTINCTCOUNT(Order number) 是最合适的。