The SQL statement
SELECT ROUND(45.926, -1) FROM DUAL;
A. is illegal
B. prints garbage
C. prints 045.926
D. prints 50
Answer: Option D
Solution(By Examveda Team)
The ROUND function in SQL is used to round a number to a specified precision. The syntax is:
ROUND (expression, [decimal place])
where [decimal place] indicates the number of decimal points returned. A negative number means the rounding will occur to the digit to the left of the decimal point. For example, -1 means the number will be rounded to the nearest tens.
For above given example, the output would be 50 because the nearest tens of 45.926, is 50.
Taking another example, if we have to round (44.678, -1), the out put would be 40, because the nearest tens of 44.678 is 40.
Join The Discussion
Comments ( 3 )
A. Structured Query Language
B. Structured Query List
C. Simple Query Language
D. None of these
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
A. Data Definition Language(DDL)
B. Data Manipulation Language(DML)
C. Both of above
D. None
Which operator performs pattern matching?
A. BETWEEN operator
B. LIKE operator
C. EXISTS operator
D. None of these
What operator tests column for the absence of data?
A. EXISTS operator
B. NOT operator
C. IS NULL operator
D. None of these
round(45.926,-1) => will it give 46.0 or 50 ?
Then what will round(49.926,-1) will give ?
Iam a bit confused of the way it is performing, can anyone give any clarifications reg this ?
if plus 1 then
if the salary of all the employees is greater than the given condition than all the records will be display.
Ex: if all the employee salary is above 10000 and the condition is salary>8000 than all the records will be display.