OCP-1Z0-051-题目解析-第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% areapplied 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 parentheses 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.
Answer: B
题目解析:
题目的意思是:表中产品的价格降价25%后,加上税金15%,再加上运费100后产品的新价格。题目给出了产品新价格的sql语句,
问,如果把该sql语句的括号都去了,结果会怎样?
这题也是考表达式的运算顺序
原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 where rownum
页:
[1]