SQL语句“delete from department”,需要

题目

SQL语句“delete from department”,需要SqlCommand对象的哪一个方法在执行()。

  • A、ExecuteNonQuery()
  • B、ExecuteScalar()
  • C、ExecuteReader()
  • D、ExecuteXmlReader()
参考答案和解析
正确答案:A
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

从订单表中删除客户号为"1001”的订单记录,正确的SQL语句是A)DROP FROM订单WHERE客户号="1001"B)DROP FROM订单FOR客户号="1001"C)DELETE FROM订单WHERE客户号="1001"D)DELETE FROM订单FOR客户号="1001"


正确答案:C
SQL语句的删除表书写格式为:
  DELETE FROM<表名> [WHERE 条件表达式]
故选项C为正确答案。

第2题:

在VisualFoxPro中,如果要将学生表S(学号,姓名,性别,年龄)的“年龄”属性删除,正确的SQL语句是( )。

A) ALTER TABLE S DROP COLUMN年龄

B)DELETE年龄FROM S

C)ALTER TABLE S DELETE COLUMN年龄

D)ALTER TABLE S DELETE年龄


正确答案:A

第3题:

下列SQL语句中,修改表结构的语句是()。

A.ALTER

B.INSERT

C.UPDATE

D.DELETE


正确答案:A

第4题:

根据SQL标准,要删除表student中所有数据,但不将表student的定义一起删除,下面哪个语句可以适用?()

A delete from student

B delete all from student

C delete * from student

D drop table student


参考答案A

第5题:

用SQL语句进行记录的删除操作,使用 DELETE 语句。()


参考答案正确

第6题:

使用SQL语句将学生表S中年龄(AGE)大于30岁的记录删除,正确的命令是A)DELETE FOR AGE>30 B)DELETE FROM S WHERE AGE>30C)DELETE S FOR AGE>30 D)DELETE S WHERE AGE>30


正确答案:B
题目中考查的SQL的DELETE命令,语法格式为:
DELETE FROM 表名[WHERE 条件表达式〕
故选项B为正确答案。

第7题:

下面SQL语句不正确的是()

A.Select*from user

B.update user set username=’zhangsan’where id=’2’

C.Delete*from user

D.insert into user values(1,’zhang’,’pass’);


参考答案:C

第8题:

使用SQL语句将学生表S中年龄(AGE)大于30岁的记录删除,正确的命令是( )。

A.DELETE FOR AGE>30

B.DELETE FROM S WHERE AGE>30

C.DELETE S FOR AGE>30

D.DELETE S WHERE AGE>30


正确答案:B

第9题:

根据SQL标准,删除索引应该选用下面哪个语句?()

A DELETE INDEX

B DROP INDEX

C DELETE VIEW

D DROP VIEW


参考答案B

第10题:

Examine the data in the EMPLOYEES and DEPARTMENTS tables:Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables:On the EMPLOYEES table, EMPLOYEE_ID is the primary key.MGR_ID is the ID of managers and refers to the EMPLOYEE_ID.DEPT_ID is foreign key to DEPARTMENT_ID column of the DEPARTMENTS table.On the DEPARTMENTS table, DEPARTMENT_ID is the primary key.Examine this DELETE statement:What happens when you execute the DELETE statement?()

A. Only the row with department ID 40 is deleted in the DEPARTMENTS table.

B. The statement fails because there are child records in the EMPLOYEES table with department ID 40.

C. The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 110 and 106 are deleted from the EMPLOYEES table.

D. The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 106 and 110 and the employees working under employee 110 are deleted from the EMPLOYEES table.

E. The row with department ID 40 is deleted in the DEPARTMENTS table. Also all the rows in the EMPLOYEES table are deleted.

F. The statement fails because there are no columns specifies in the DELETE clause of the DELETE statement.


参考答案:B

更多相关问题