首页 > 其他 > 详细

052-165

时间:2017-12-14 18:24:48      阅读:191      评论:0      收藏:0      [点我收藏+]

You have an ORDERS table with the following structure:
Name Null? Type
----------- -------- ------------------
OID NUMBER(6)
ODATE DATE
CCODE NUMBER(6)
OAMT NUMBER(10,2)
The table has data in the ODATE column for all rows. Many orders are placed in a single day. You need to ensure that the ODATE column must contain data for every order in future.
Which method would serve the purpose?
A. Modify the column using the ALTER TABLE ... MODIFY command.
B. Add a UNIQUE constraint to the column using the ALTER TABLE ... ADD CONSTRAINT command.
C. Add a NOT NULL constraint to the column using the ALTER TABLE ... ADD CONSTRAINT command.
D. Add a PRIMARY KEY constraint to the column using the ALTER TABLE ... ADD CONSTRAINT command

  为保证 ODATE 列必有数据,可以添加一个 NOT NULL 约束,添加非空约束使用 alter table modify,其它的约束使用alter table add constraint

052-165

原文:http://www.cnblogs.com/Babylon/p/8039092.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!