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

备考刷题,请到

CDA认证小程序

There is an existing table named "orders" in a database, which includes the fields: order_id varchar(10), p_id varchar(10), type varchar(20), amount decimal(10,2). In the database, which of the following uses of the table name "orders" and the field name "amount" is correct?
A. orders.amount
B. orders_amount
C. orders$amount
D. orders[amount]
上一题
下一题
收藏
点赞
评论
题目解析
题目评论(0)

In a database, the delimiter is ".".

正确答案是:A: orders.amount

专业分析:
在关系数据库中,引用表中的字段通常使用“表名.字段名”的格式。这种格式清晰地表明了字段所属的表,并且在SQL查询中是标准的语法。

具体分析如下:
1. **A: orders.amount** - 这是正确的SQL语法,表示从表"orders"中引用字段"amount"。
2. **B: orders_amount** - 这种格式通常用于命名变量、视图或其他数据库对象,而不是直接引用表中的字段。
3. **C: orders$amount** - 这种格式在SQL中是不合法的,符号"$"在字段引用中没有特殊含义。
4. **D: orders[amount]** - 这种格式在SQL中是不合法的,方括号通常用于引用包含特殊字符或保留字的表名或字段名,但不是用来引用字段。

因此,正确的使用方法是A: orders.amount。