Examine this list of queries:
Which two statements are true? (Choose two.)
Examine this list of queries:
Which two statements are true? (Choose two.)
To understand which statements are true, let's break down the SQL functions and their behaviors in the provided queries. 1. SELECT ROUND(TRUNC(15.193, 1)) FROM DUAL: TRUNC(15.193, 1) truncates the value to a single decimal place, resulting in 15.1. ROUND(15.1) then rounds this truncated value, leaving it as 15. 2. SELECT ROUND(15.193, -1) FROM DUAL: ROUND(15.193, -1) rounds the value to the nearest 10, resulting in 20. 3. SELECT TRUNC(15.193, -1) FROM DUAL: TRUNC(15.193, -1) truncates the value to the nearest 10 without rounding, resulting in 10. 4. SELECT TRUNC(ROUND(15.193, 1)) FROM DUAL: ROUND(15.193, 1) rounds the original value to a single decimal place, resulting in 15.2. TRUNC(15.2) then truncates this value, leaving it as 15. From the above analysis, it's evident that 2 returns the value 20, and 1 and 4 give the same result.
BD is correct
BD tested SELECT ROUND (TRUNC (15.193, 1)) "Results" FROM DUAL; SELECT ROUND (15.193, -1) "Results" FROM DUAL; SELECT TRUNC (15.193, -1) "Results" FROM DUAL; SELECT TRUNC (ROUND (15.193, 1)) "Results" FROM DUAL;
15,20,10,15 is result
Answer B,D
B, D Correct tested in Oracle
Checked, B, D is correct