码迷,mamicode.com
首页 > 其他好文 > 详细

052-165

时间:2017-12-14 19:31:58      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:round   back   serve   com   nts   any   oam   使用   hat   

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

标签:round   back   serve   com   nts   any   oam   使用   hat   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!