zoukankan      html  css  js  c++  java
  • OCP-1Z0-051-V9.02-86题

    86. Examine the structure and data of the CUST_TRANS table:

    CUST_TRANS 

    Name       Null           Type

    CUSTNO      NOT NULL       CHAR(2)

    TRANSDATE                 DATE

    TRANSAMT                  NUMBER(6,2)

    CUSTNO TRANSDATE       TRANSAMT

    11      01-JAN-07       1000

    22      01-FEB-07       2000

    33      01-MAR-07       3000

    Dates are stored in the default date format dd-mon-rr in the CUST_TRANS table.

    Which SQL statements would execute successfully? (Choose three .)

    A. SELECT transdate + '10' FROM cust_trans; 

    B. SELECT * FROM cust_trans WHERE transdate  =   '01-01-07'; 

    C. SELECT transamt FROM cust_trans WHERE custno > '11'; 

    D. SELECT * FROM cust_trans WHERE transdate='01-JANUARY-07'; 

    E. SELECT custno + 'A' FROM cust_trans WHERE transamt > 2000; 

    Answer: ACD

    答案解析:

    参考:http://blog.csdn.net/rlhua/article/details/12832019

    对于表达式计算,Oracle Server 可以自动执行以下转换:
    从NUMBER隐式转换为VARCHAR2 或CHAR
    从 DATE隐式转换为VARCHAR2 或CHAR


    A,日期隐式转换为字符型。正确

    B,  '01-01-07'为特定格式,需要用to_date函数转换。

    C,custno 为字符,字符与字符相比较,正确。

    D, 01-JAN-07 等同于01-JANUARY-07,不需要转换函数,可隐式转换。正确。

    E,错误,不能使用+。


  • 相关阅读:
    SEO
    Hack写法
    文学漫步
    [BZOJ4565] [Haoi2016] 字符合并
    [bzoj 3123][Sdoi2013]森林
    [UVA 12633] Super Rooks on Chessboard FFT+计数
    [HDU4609] 3-idiots FFT+计数
    [bzoj4554] [Tjoi2016&Heoi2016]游戏
    [bzoj4556] [Tjoi2016&Heoi2016]字符串
    [bzoj4552][Tjoi2016&Heoi2016]排序
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13316887.html
Copyright © 2011-2022 走看看