单选题你要关闭SALES表中UNIT_PRICE列的非NULL约束。下列哪个语句能完成这个操作?()A alter table sales modify(unit_prices null)B alter table sales modify(unit_prices not null)C alter table sales add(unit_prices null)D alter table sales add(unit_prices not null)

题目
单选题
你要关闭SALES表中UNIT_PRICE列的非NULL约束。下列哪个语句能完成这个操作?()
A

alter table sales modify(unit_prices null)

B

alter table sales modify(unit_prices not null)

C

alter table sales add(unit_prices null)

D

alter table sales add(unit_prices not null)


相似考题
参考答案和解析
正确答案: B
解析: 暂无解析
更多“单选题你要关闭SALES表中UNIT_PRICE列的非NULL约束。下列哪个语句能完成这个操作?()A alter table sales modify(unit_prices null)B alter table sales modify(unit_prices not null)C alter table sales add(unit_prices null)D alter table sales add(unit_prices not null)”相关问题
  • 第1题:

    一个学生信息表student,要求它由学号sno,姓名sname,性别sex,年龄age,4个属性组成。现在对这个现有的表增加一个入学时间cometime字段为日期型,下列语句正确的是

    A.ALTER TABLE student ADD cometime DATE NOT NULL;

    B.ALTER TABLE student ADD cometime DATE;

    C.ALTER TABLE student DROP cometime DATE NOT NULL:

    D.ALTER TABLE student MODIFY cometime DATE;


    正确答案:B
    解析:新增加的列一律允许为空值。故A)错。DROP用于删除指定的完整性约束,故C)错。MODIFY用于修改原有的列定义,故D)错。

  • 第2题:

    如果希望更新表authors中的first_name列为非空,那么可以使用哪个语句?()

    • A、alter table authors add first_name not null
    • B、alter table authors modify first_name not null
    • C、alter table authors alter first_name not null
    • D、alter table authors drop first_name not null

    正确答案:B

  • 第3题:

    为表TEST中ID列添加主键约束的语法是()

    • A、ALTER  TABLE  TEST  CHANGE( ID  INT  PRIMARY  KEY)
    • B、ALTER  TABLE  TEST  ADD( ID  INT  PRIMARY  KEY)
    • C、ALTER  TABLE  TEST  MODIFY( ID  INT  PRIMARY  KEY)
    • D、ALTER  TABLE  TEST  ADD  CONSTRAINT PK  PRIMARY KEY (ID)

    正确答案:D

  • 第4题:

    在SQL Server中,修改表中列定义的正确的SQL语句是()。

    • A、ALTER TABLE 表名 ALTER COLUMN 列名 数据类型
    • B、ALTER TABLE 表名 ALTER 列名 数据类型
    • C、ALTER TABLE MODIFY COLUMN 列名 数据类型
    • D、ALTER TABLE 表名 ADD 列名 数据类型

    正确答案:A

  • 第5题:

    You just issued the following statement: ALTER TABLE SALES DROP COLUMN PROFIT. Which of the following choices identifies when the column will actually be removed from Oracle?()

    • A、Immediately following statement execution 
    • B、After the ALTER TABLE DROP UNUSED COLUMNS command is issued 
    • C、After the ALTER TABLE SET UNUSED COLUMN command is issued 
    • D、After the ALTER TABLE MODIFY command is issued

    正确答案:B

  • 第6题:

    You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()

    • A、ALTER TABLE students ADD PRIMARY KEY student_id;
    • B、ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);
    • C、ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
    • D、ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);

    正确答案:C

  • 第7题:

    Examine the following statement that is used to modify the primary key constraint on the SALES table: SQL> ALTER TABLE SALES MODIFY CONSTRAINT pk DISABLE VALIDATE; Which three statements aretrue regarding the above command()

    • A、The constraint remains valid.
    • B、The index on the constraint is dropped.
    • C、It allows the loading of data into the table using SQL *Loader.
    • D、New data conforms to the constraint, but existing data is not checked.
    • E、It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements.

    正确答案:A,B,C

  • 第8题:

    发出下列语句:alter table sales drop columm profit;何时从Oracle中实际删除列?()

    • A、执行语句后立即删除
    • B、发出alter table drop unused columns命令之后
    • C、发出alter table set unused columns命令之后
    • D、发出alter table modify命令之后

    正确答案:A

  • 第9题:

    You are modifying a table named Product in a SQL Server 2005 database. You want to add a new column named FriendlyName to the Product table. A friendly name for each product will be stored in this column. The table currently contains data. The sales department has not yet created a friendly name for each product. FriendlyName is a required value for each product. You want to add this new column by using the least amount of effort. What should you do?()

    • A、Define the new column as NULL.Update the FriendlyName column to the same value as the productName column. Alter the FriendlyName column to be NOT NULL.
    • B、Define the new column as NOT NULL with a default value of ’Undefined.’
    • C、Define the new column as NULL. Use application logic to enforce the data constraint.
    • D、Define the new column as NULL with a default value of ’Undefined.’

    正确答案:B

  • 第10题:

    单选题
    发出下列语句:alter table sales drop columm profit;何时从Oracle中实际删除列?()
    A

    执行语句后立即删除

    B

    发出alter table drop unused columns命令之后

    C

    发出alter table set unused columns命令之后

    D

    发出alter table modify命令之后


    正确答案: D
    解析: 暂无解析

  • 第11题:

    单选题
    The EMPLOYEES table has these columns:LAST_NAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATEManagement wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement:ALTER TABLE EMPLOYEES MODIFY (SALARY DEFAULT 5000);Which is true about your ALTER statement?()
    A

    Column definitions cannot be altered to add DEFAULT values.

    B

    A change to the DEFAULT value affects only subsequent insertions to the table.

    C

    Column definitions cannot be altered to add DEFAULT values for columns with a NUMBER data type.

    D

    All the rows that have a NULL value for the SALARY column will be updated with the value 5000.


    正确答案: B
    解析: 暂无解析

  • 第12题:

    单选题
    You just issued the following statement: ALTER TABLE SALES DROP COLUMN PROFIT. Which of the following choices identifies when the column will actually be removed from Oracle?()
    A

    Immediately following statement execution 

    B

    After the ALTER TABLE DROP UNUSED COLUMNS command is issued 

    C

    After the ALTER TABLE SET UNUSED COLUMN command is issued 

    D

    After the ALTER TABLE MODIFY command is issued


    正确答案: A
    解析: 暂无解析

  • 第13题:

    删除学生表STUD中关于学号XH必须取惟一值的约束。实现该功能的正确SQL语句是 ______。

    A.ALTER TABLE STUD ADD XH UNIQUE

    B.ALTER TABLE STUD MODIFY XHUNIQUE

    C.ALTER TABLE STUD DROP UNIQUE(XH)

    D.ALTER TABLE STUD MODIFY UNIQUE(XH)


    正确答案:C

  • 第14题:

    下列有关NOT NULL约束条件的表述中,哪两项是正确的?()

    • A、Oracle Server会为未命名的NOT NULL约束条件创建名称。
    • B、可以在表级或列级定义NOT NULL约束条件。
    • C、NOT NULL约束条件要求列中的每个值都是唯一的。
    • D、有NOT NULL约束条件的列默认可以包含空值。
    • E、不能使用ALTER TABLE ADD CONSTRAINT语句向现有列添加NOT NULL约束条件。

    正确答案:A,E

  • 第15题:

    要向雇员表中的部门标识列添加FOREIGNKEY约束条件以引用部门表中的标识列,应该使用哪个语句()

    • A、ALTER TABLE雇员MODIFY COLUMN dept_id_fk FOREIGN KEY(部门标识)REFERENCES部门(部门标识)
    • B、ALTER TABLE雇员ADD CONSTRAINT dept_id_fk FOREIGNKEY(部门标识)REFERENCES部门(部门标识)
    • C、ALTER TABLE雇员ADD FOREIGN KEY CONSTRAINT dept_id_fk ON(部门标识)REFERENCES部门(部门标识)
    • D、ALTER TABLE雇员ADD FOREIGN KEY 部门(部门标识)REFERENCES(部门标识)

    正确答案:B

  • 第16题:

    如下能正确执行的语句是()

    • A、select * from table_name where 1<=2
    • B、truncate table table_name
    • C、delete from table_name where null=null
    • D、alter table table_name add column idd int

    正确答案:A,B,C

  • 第17题:

    Which statement adds a constraint that ensures the CUSTOMER_NAME column of the CUSTOMERS table holds a value?()

    • A、ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;
    • B、ALTER TABLE customers MODIFY CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;
    • C、ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn NOT NULL;
    • D、ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn IS NOT NULL;
    • E、ALTER TABLE customers MODIFY name CONSTRAINT cust_name_nn NOT NULL;
    • F、ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name NOT NULL;

    正确答案:C

  • 第18题:

    Examine the following statement that is used to modify the constraint on the SALES table: SQL> ALTER TABLE SALES MODIFY CONSTRAINT pk DISABLE VALIDATE; Which three statements are true regarding the above command()

    • A、The constraint remains valid.
    • B、The index on the constraint is dropped.
    • C、It allows the loading of data into the table using SQL*Loader.
    • D、New data conforms to the constraint, but existing data is not checked
    • E、It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements.

    正确答案:A,B,C

  • 第19题:

    The EMPLOYEES table has these columns:LAST_NAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATEManagement wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement:ALTER TABLE EMPLOYEES MODIFY (SALARY DEFAULT 5000);Which is true about your ALTER statement?()

    • A、Column definitions cannot be altered to add DEFAULT values.
    • B、A change to the DEFAULT value affects only subsequent insertions to the table.
    • C、Column definitions cannot be altered to add DEFAULT values for columns with a NUMBER data type.
    • D、All the rows that have a NULL value for the SALARY column will be updated with the value 5000.

    正确答案:B

  • 第20题:

    你要关闭SALES表中UNIT_PRICE列的非NULL约束。下列哪个语句能完成这个操作?()

    • A、alter table sales modify(unit_prices null)
    • B、alter table sales modify(unit_prices not null)
    • C、alter table sales add(unit_prices null)
    • D、alter table sales add(unit_prices not null)

    正确答案:A

  • 第21题:

    单选题
    你要关闭SALES表中UNIT_PRICE列的非NULL约束。下列哪个语句能完成这个操作?()
    A

    alter table sales modify(unit_prices null)

    B

    alter table sales modify(unit_prices not null)

    C

    alter table sales add(unit_prices null)

    D

    alter table sales add(unit_prices not null)


    正确答案: A
    解析: 暂无解析

  • 第22题:

    单选题
    如果希望更新表authors中的first_name列为非空,那么可以使用哪个语句?()
    A

    alter table authors add first_name not null

    B

    alter table authors modify first_name not null

    C

    alter table authors alter first_name not null

    D

    alter table authors drop first_name not null


    正确答案: D
    解析: 暂无解析

  • 第23题:

    单选题
    You are modifying a table named Product in a SQL Server 2005 database. You want to add a new column named FriendlyName to the Product table. A friendly name for each product will be stored in this column. The table currently contains data. The sales department has not yet created a friendly name for each product. FriendlyName is a required value for each product. You want to add this new column by using the least amount of effort. What should you do?()
    A

    Define the new column as NULL.Update the FriendlyName column to the same value as the productName column. Alter the FriendlyName column to be NOT NULL.

    B

    Define the new column as NOT NULL with a default value of ’Undefined.’

    C

    Define the new column as NULL. Use application logic to enforce the data constraint.

    D

    Define the new column as NULL with a default value of ’Undefined.’


    正确答案: D
    解析: 暂无解析

  • 第24题:

    单选题
    Which statement adds a constraint that ensures the CUSTOMER_NAME column of the CUSTOMERS table holds a value?()
    A

    ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;

    B

    ALTER TABLE customers MODIFY CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;

    C

    ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn NOT NULL;

    D

    ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn IS NOT NULL;

    E

    ALTER TABLE customers MODIFY name CONSTRAINT cust_name_nn NOT NULL;

    F

    ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name NOT NULL;


    正确答案: F
    解析: 暂无解析