What would be the outcome if all the parentheses are re…

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.

What would be the outcome if all the parentheses are removed from the above statement?

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.

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.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Tim

Tim

Tricky one … as listed the answer is indeed B.
But the weird part is that based on the description the given statement is wrong.
Shouldn’t it be:
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;
instead of:
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;
?
In which case removing all the parantheses would increase the total price value.