52、(12-11) choose the best answer:

Examine the structure and data in the PRICE_LIST table:

You plan to give a discount of 25% on the product price and need to display the discount amount

in the same format as the PROD_PRICE.

Which SQL statement would give the required result?

A) SELECT TO_CHAR (TO_NUMBER (prod_price)*.25, '$99,999.00')

FROM PRICE_LIST;

B) SELECT TO_CHAR(prod_price*.25, '$99,999.99')

FROM PRICE_LIST;

C) SELECT TO_CHAR(TO_NUMBER(prod_price,'$99,999.99')*.25,'$99,999.00')

FROM PRICE LIST;

D) SELECT TO_NUMBER (TO_NUMBER(prod_price, '$99,999.99')*.25, '$99,999.00')

FROM PRICE_LIST;

Answer:A

(解析:其实 B 答案也可以实现要求,但是它不是最好的,这里需要 to_number 转换函数,因为 prod_price 本身是 varchar2 类型,可以用如下语句实验:

SELECT TO_CHAR(to_number(sal)*.25, '$99,999.99')

FROM emp;

)

【12c OCP】最新CUUG OCP-071考试题库(52题)的更多相关文章

  1. 【OCP题库-12c】最新CUUG OCP 071考试题库(72题)

    72.View the exhibit for the structure of the STUDENTand FACULTYtables. STUDENT Name Null? Type ----- ...

  2. 【OCP题库-12c】最新CUUG OCP 071考试题库(71题)

    71.(32-18) choose three Which three statements indicate the end of a transaction? (Choose three.) A) ...

  3. 【OCP题库-12c】最新CUUG OCP 071考试题库(70题)

    70.(31-2)choose the best answer: View the Exhibit and examine the structure of the Book table. The B ...

  4. 【OCP题库-12c】最新CUUG OCP 071考试题库(69题)

    69.(31-1)choose the best answer: Evaluate the following query: SELECT INTERVAL '300' MONTH, INTERVAL ...

  5. 【OCP题库】最新CUUG OCP 12c 071考试题库(68题)

    68.(29-13)choose two: Which two statements are true? (Choose two.) A) DICTIONARY is a view that cont ...

  6. 【OCP题库】最新CUUG OCP 12c 071考试题库(67题)

    67.(25-8)choose the best answer: View the Exhibit and examine the structure of CUSTOMERS table. Eval ...

  7. 【OCP题库】最新CUUG OCP 12c 071考试题库(66题)

    66.(22-19)choose two Examine the structure proposed for the TRANSACTIONS table: Which two statements ...

  8. 【OCP题库】最新CUUG OCP 12c 071考试题库(65题)

    65.(22-16) choose the best answer: The CUSTOMERS table has the following structure: You need to writ ...

  9. 【OCP 12c】最新CUUG OCP-071考试题库(64题)

    64.(22-7) choose the best answer: View the Exhibit and examine the structure of the ORDERS and ORDER ...

  10. 【OCP 12c】最新CUUG OCP-071考试题库(63题)

    63.(22-4) choose the best answer: View the Exhibit and examine the data in the PRODUCTS table. Which ...

随机推荐

  1. .net 架构

    .net Webservice 三层架构,BLL(业务逻辑层),DAL(数据访问层)sql语句.MODEL模型层也就是实体层Entity(数据库字段和类的定义的映射). UI层(Web/Form)界面 ...

  2. TBitConverter

    TBitConverter FromBcd  FromByte  FromCurrency  FromDouble  FromExtended  FromInteger  FromLargeInt   ...

  3. 10个免费的在线Markdown编辑器

    1. StackEdit StackEdit是一个很用特色的免费在线Markdown编辑器. 有一个非常不错的工具栏,可与云存储同步,以URL形式导入文件或者直接从硬盘打入.他还有一个亮点就是,可以减 ...

  4. Beetlsql自定义生成entity,mapper,md代码

    三个模板文件 mapper.btl package ${package}; import org.beetl.sql.core.annotatoin.*; import org.beetl.sql.c ...

  5. shared_ptr&scoped_ptr&weak_ptr

    [RAII - Resource Acquisition Is Initialization] 获得一个资源的时候,不管这个资源是对象.内存.文件句柄或者其它什么,你都要在一个对象的构造函数中获得它, ...

  6. Node.js的优点和缺点(转载)

    著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.作者:FengqiAsia链接:http://www.zhihu.com/question/19653241/answer/1599 ...

  7. 01-E-1: 迭代与递归

  8. 在 macOS 中激活 Astash Professional

    Astah Professional v7.2.0-1ff236版安装完毕后,直接用压缩包内的 astah-pro.jar 替换原安装目录内的同名文件(/Applications/astah prof ...

  9. Imageloader、Glide、Fresco的性能及加载速度比较

    一.使用方式:    // 下面两个依赖包可选,根据需求二选一即可,    compile 'com.ladingwu.library:fresco:0.0.9'    compile 'com.la ...

  10. ASP.NET 4(和ASP.NET MVC 2)中输出HTML编码的新语法<%:%>

    今天的文章介绍了ASP.NET 4中引入的一个小而且非常有用的新语法功能 - 这是在代码块中自动对输出进行HTML编码的功能.这有助于保护您的应用程序和站点免受跨站点脚本注入(XSS)和HTML注入攻 ...