052-165

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

posted @ 2017-12-14 18:05  巴啦啦大魔王  阅读(179)  评论(0编辑  收藏  举报