36.Examine the following SQL commands:

36.Examine the following SQL commands:


SQL>CREATE TABLE products (
           prod_id NUMBER(3) CONSTRAINT p_ck CHECK (prod_id > 0),
           prod_name CHAR(30),
           prod_qty NUMBER(6),
           CONSTRAINT p_name NOT NULL,
           CONSTRAINT prod_pk PRIMARY KEY (prod_id)
           );
           
SQL>CREATE TABLE warehouse (
           warehouse_id NUMBER(4),
           roomno NUMBER(10) CONSTRAINT r_id CHECK(roomno BETWEEN 101 AND 200),
           location VARCHAR2(25),
           prod_id NUMBER(3),
           CONSTRAINT wr_pr_pk PRIMARY KEY (warehouse_id,prod_id),
           CONSTRAINT prod_fk FOREIGN KEY (prod_id) REFERENCES products(prod_id)
           );


Which statement is true regarding the execution of the above SQL commands?
A.Both commands execute successfully.
B.The first CREATE TABLE command generates an error because the NULL constraint is not valid.
C.The second CREATE TABLE command generates an error because the CHECK constraint is not valid.
D.The first CREATE TABLE command generates an error because CHECK and PRIMARY KEY constraints cannot be used for the same column.
E.The first CREATE TABLE command generates an error because the column PROD_ID cannot be used in the PRIMARY KEY and FOREIGN KEY constraints.
答案:B
解析:not null只能定义在列级别,因此第一个语句错误,因此选择B
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
14:39:13.561 INFO Starting development server... 14:39:38.583 WARNING: Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-cell-item/u-cell-item.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\examine' 14:39:38.585 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-cell-item/u-cell-item.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\pensionResources' 14:39:38.594 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-mask/u-mask.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\pages\service' 14:39:38.595 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-section/u-section.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\examine' 14:39:38.601 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-section/u-section.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\knowledgeBase' 14:39:38.602 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-section/u-section.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\pages\notice' 14:39:38.608 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-select/u-select.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\examine' 14:39:38.609 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-select/u-select.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\knowledgeBase' 14:39:38.614 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-select/u-select.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\pages\service' 14:39:38.621 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-select/u-select.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\subpages\assessment-admission' 14:39:38.621 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-select/u-select.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\subpages\assessment-orgHomeBed' 14:39:38.629 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-select/u-select.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\subpages\assessment-respiteCare' 14:39:38.629 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-th/u-th.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\fms' 14:39:38.635 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-upload-enclosure/u-upload-enclosure.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\examine' 14:39:38.636 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-waterfall/u-waterfall.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\examine' 14:39:38.640 Module not found: Error: Can't resolve '@/uni_modules/uview-ui/components/u-waterfall/u-waterfall.vue' in 'D:\ideaWorkSpace\xinjian\ehl-wx\applicationCenter\knowledgeBase'解决
最新发布
07-14

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值