105.Examine the structure of the PROMOS table:
来源:互联网 发布:avdb.la新域名2017 编辑:程序博客网 时间:2024/06/05 19:40
105.Examine the structure of the PROMOS table:
name Null Type
PROMO_ID NOT NULL NUMBER(3)
PROMO_NAME VARCHAR2(30)
PROMO_START_DATE NOT NULL DATE
PROMO_END_DATE NOT NULL DATE
You want to display the list of promo names with the message 'Same Day' for promos that started and
ended on the same day.
Which query gives the correct output?
A.SELECT promo_name, NVL(NULLIF(promo_start_date, promo_end_date), 'Same Day') FROM promos;
B.SELECT promo_name, NVL(TRUNC(promo_end_date - promo_start_date), 'Same Day') FROM promos;
C.SELECT promo_name, NVL2(TO_CHAR(TRUNC(promo_end_date-promo_start_date)), NULL,'Same Day') FROM promos;
D.SELECT promo_name, DECODE((NULLIF(promo_start_date, promo_end_date)), NULL,'Same day') FROM promos;
答案:D
解析:
A:错误,nvl 参数类型必须相同
B:错误,同上
C:错误,TO_CHAR(TRUNC(promo_end_date-promo_start_date)这个值肯定不为null,nvl2的结果就是null
D:正确
name Null Type
PROMO_ID NOT NULL NUMBER(3)
PROMO_NAME VARCHAR2(30)
PROMO_START_DATE NOT NULL DATE
PROMO_END_DATE NOT NULL DATE
You want to display the list of promo names with the message 'Same Day' for promos that started and
ended on the same day.
Which query gives the correct output?
A.SELECT promo_name, NVL(NULLIF(promo_start_date, promo_end_date), 'Same Day') FROM promos;
B.SELECT promo_name, NVL(TRUNC(promo_end_date - promo_start_date), 'Same Day') FROM promos;
C.SELECT promo_name, NVL2(TO_CHAR(TRUNC(promo_end_date-promo_start_date)), NULL,'Same Day') FROM promos;
D.SELECT promo_name, DECODE((NULLIF(promo_start_date, promo_end_date)), NULL,'Same day') FROM promos;
答案:D
解析:
A:错误,nvl 参数类型必须相同
B:错误,同上
C:错误,TO_CHAR(TRUNC(promo_end_date-promo_start_date)这个值肯定不为null,nvl2的结果就是null
D:正确
0 0
- 105.Examine the structure of the PROMOS table:
- 104.Examine the structure of the PROMOS table:
- 94.Examine the structure of the PROGRAMS table:
- 6.Examine the structure of the SHIPMENTS table:
- 18.Examine the structure of the PROMOTIONS table:
- 86.Examine the structure and data of the CUST_TRANS table:
- 96.Examine the structure of the INVOICE table.
- 102.Examine the structure of the TRANSACTIONS table:
- 103.Examine the structure of the TRANSACTIONS table:
- 109.Examine the structure of the MARKS table:
- 113.Examine the structure of the ORDERS table:
- 125.Examine the structure of the CUSTOMERS table:
- 140.Examine the structure of the PRODUCTS table:
- 8.View the Exhibit and examine the structure of the CUSTOMERS table.
- 10.View the Exhibit;examine the structure of the PROMOTIONS table.
- 11.View the Exhibit and examine the structure of the PRODUCTS table.
- 13.View the Exhibit and examine the structure of the PRODUCTS table.
- 44.View the Exhibit and examine the structure of the ORD table.
- iOS UItextField控件详解
- javascript代码获取css属性
- Restful Web Service
- 一年经验IOS开发者的面试记录(问题涵盖比较广)
- 去掉详细页网址中的日期 简化详细页的地址
- 105.Examine the structure of the PROMOS table:
- maven + eclipse(Mars.2 Release (4.5.2))错误异常处理
- iOS开发 之 可穿戴设备 蓝牙4.0 BLE 开发
- Hbase总结:Hbase中的Coprocessor
- 文本聚类算法之k-means聚类
- Android Get方法和POST方法发送请求
- 面试
- LintCode Wiggle Sort II
- 如何在Ubuntu上安装visual studio code