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

备考刷题,请到

CDA认证小程序

The table "t1" has three columns: "id," "name," and "salary." If "t1" represents a forum's posting information table, where "id" is the poster's ID, "name" is the post's title, and "salary" is the score awarded for each post on the forum. The statement that represents updating the content of fields in the "t1" table is:
A. create table t1(id int, name char(30), salary int);
B. drop table t1;
C. create view v_t1 as select id, name from t1;
D. update t1 set name='lixiaoming' where id=100;
上一题
下一题
收藏
点赞
评论
题目解析
题目评论(0)

The UPDATE...SET... statement is used to modify the content of fields in a table.

正确答案是:D: update t1 set name='lixiaoming' where id=100;

专业分析如下:

A: `create table t1(id int, name char(30), salary int);` 这个语句是用来创建一个名为 `t1` 的表,包含三个字段:`id`, `name`, 和 `salary`。它并不是用来更新表中字段内容的,因此不正确。

B: `drop table t1;` 这个语句是用来删除表 `t1`,它会直接删除整个表及其数据,也不是用来更新表中字段内容的,因此不正确。

C: `create view v_t1 as select id, name from t1;` 这个语句是用来创建一个名为 `v_t1` 的视图,视图是基于表 `t1` 的 `id` 和 `name` 字段的一个虚拟表。它同样不是用来更新表中字段内容的,因此不正确。

D: `update t1 set name='lixiaoming' where id=100;` 这个语句是用来更新表 `t1` 中的记录的。具体来说,它将 `id` 为 `100` 的那条记录的 `name` 字段更新为 `lixiaoming`。这个语句正是用来更新表中字段内容的,因此是正确的。

综上所述,选项 D 是正确的答案。