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

备考刷题,请到

CDA认证小程序

The primary key of an e-commerce order table is order number. Based on business logic, which of the following fields should NOT be stored in the orders table?()
A. Customer ID
B. Product name
C. Payment time
D. Product amount
上一题
下一题
收藏
点赞
评论
题目解析
题目评论(0)

An order can contain multiple products, so storing product name would violate the primary key constraint. Similarly, product amount should not be stored either, order amount is fine. So BD are the answers.

正确答案是:B: Product name

专业分析:

在设计电商订单表时,通常会考虑以下几个关键字段:

1. **Customer ID**:用于标识下订单的客户,这是订单表中非常重要的信息,便于追踪和管理客户的订单记录。
2. **Payment time**:用于记录订单支付的时间,帮助管理订单的付款状态和时间轴。
3. **Product amount**:用于记录订单中产品的数量,这是订单详情的重要组成部分。

而**Product name**(产品名称)不应该存储在订单表中,原因如下:

- **冗余数据**:产品名称可能会发生变化,如果直接存储在订单表中,会导致数据冗余和一致性问题。通常,产品名称会存储在一个独立的产品表(如Product表)中,订单表只需要存储产品的唯一标识(如Product ID),通过外键关联到产品表获取产品名称。
- **数据规范化**:为了数据库的规范化设计,减少数据冗余,提升查询效率,订单表应尽量只存储与订单直接相关的信息,而不是详细的产品信息。

综上所述,**Product name**不应该存储在订单表中,而是通过关联关系从产品表中获取。