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

    75. The following data exists in the PRODUCTS table:

    PROD_ID     PROD_LIST_PRICE

    123456        152525.99

    You issue the following query:

    SQL> SELECT RPAD(( ROUND(prod_list_price)), 10,'*')     

    FROM products     

    WHERE prod_id = 123456;

    What would be the outcome?

    A. 152526 ****

    B. **152525.99

    C. 152525** **

    D. an error message

    Answer: A

     答案解析:

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


    Round( ) 函数 

    传回一个数值,该数值是按照指定的小数位元数进行四舍五入运算的结果 
    语法
    ROUND( number, decimal_places ) 
    number : 需四舍五入处理的数值 
    decimal_places : 四舍五入 , 小数取几位 ( 预设为 0 )

     RPAD:返回一个表达式,右边使用一个字符表达式填充到n 个字符的长度。

    实验验证:
    scott@TESTDB> create table products(prod_id number,prod_list_price number);
     
    Table created.
     
    scott@TESTDB> insert into products values(123456,152525.99);
     
    1 row created.
     
    scott@TESTDB> select * from  products;
     
       PROD_ID PROD_LIST_PRICE
    ---------- ---------------
        123456       152525.99
     
    scott@TESTDB> select round(PROD_LIST_PRICE) from products;
     
    ROUND(PROD_LIST_PRICE)
    ----------------------
                    152526
    scott@TESTDB> select rpad((round(PROD_LIST_PRICE)),10,'*') from products;
     
    RPAD((ROUND(PROD_LIS
    --------------------
    152526****



     
  • 相关阅读:
    Codeforces Round #398 (Div. 2) B,C
    KMP模板
    HDU1711 KMP(模板题)
    HDU3265 线段树(扫描线)
    HDU2795 线段树
    HDU1828线段树(扫描线)
    HDU1832 二维线段树求最值(模板)
    HDU1698 线段树(区间更新区间查询)
    HDU3251 最大流(最小割)
    cf2.c
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13316898.html
Copyright © 2011-2022 走看看