• OCP-1Z0-051-V9.02-11题


    11. View the Exhibit and examine the structure of the PRODUCTS table.
    All products have a list price.
    You issue the following command to display the total price of each product after a discount of 25% and a
    tax of 15% are  applied on it. Freight charges of $100 have to be applied to all the products.
    SQL>SELECT prod_name, prod_list_price -(prod_list_price*(25/100))                 
    +(prod_list_price -(prod_list_price*(25/100))*(15/100))+100                                 
    AS "TOTAL PRICE"
    FROM products;
    What would be the outcome if all the parenthese s are removed from the above statement?
     
    A. It produces a syntax error.
    B. The result remains unchanged.
    C. The total price value would be lower than the correct value.
    D. The total price value would be higher than the correct value.
     
    sh@TESTDB> SELECT prod_name, prod_list_price -(prod_list_price*(25/100))                  
      2  +(prod_list_price -(prod_list_price*(25/100))*(15/100))+100                                  
      3  AS "TOTAL PRICE" 
      4  FROM products where rownum<6 
      5  order by "TOTAL PRICE";
    
    PROD_NAME                                          TOTAL PRICE
    -------------------------------------------------- -----------
    Y Box                                               613.732875
    5MP Telephoto Digital Camera                        1641.23288
    17" LCD w/built-in HDTV Tuner                       1812.48288
    Envoy 256MB - 40GB                                  1812.48288
    Mini DV Camcorder with 3.5" Swivel LCD              1983.73288

    去除括号后:
    sh@TESTDB>  SELECT prod_name, prod_list_price -prod_list_price*25/100
      2  +prod_list_price -prod_list_price*25/100*15/100+100 
      3  AS "TOTAL PRICE"
      4  FROM products where rownum<6
      5  order by "TOTAL PRICE";
    
    PROD_NAME                                          TOTAL PRICE
    -------------------------------------------------- -----------
    Y Box                                               613.732875
    5MP Telephoto Digital Camera                        1641.23288
    17" LCD w/built-in HDTV Tuner                       1812.48288
    Envoy 256MB - 40GB                                  1812.48288
    Mini DV Camcorder with 3.5" Swivel LCD              1983.73288

    虽然计算顺序不一样,但计算结果是一样的
     
    此题答案选:B
  • 相关阅读:
    如何通过命令行窗口查看sqlite数据库文件
    eclipse自动补全的设置
    文本装饰
    注释和特殊符号
    文本装饰
    网页背景
    通过ArcGIS Server admin 查看和删除已注册的 Web Adaptor
    通过 ArcGIS Server Manager 查看已安装的 Web Adaptor
    通过 ArcGIS Server Manager 验证 DataStore
    Windows上安装ArcGIS Enterprise——以 Windows Server 2012 R2上安装 ArcGIS 10.8为例
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317265.html
Copyright © 2020-2023  润新知