Informatics Practices
Find the output of the following SQL Query :
SELECT MOD(ROUND (13.9, 0), 3);
SQL Queries
4 Likes
Answer
+------------------------+
| MOD(ROUND(13.9, 0), 3) |
+------------------------+
| 2 |
+------------------------+
Working
In the above query, 13.9 is first rounded to the nearest whole number (0 decimal places), resulting in 14 using the ROUND
function. Then, the MOD
function computes the remainder of 14 divided by 3, resulting in 2. Therefore, the output of the query is 2.
Answered By
1 Like
Related Questions
Consider two fields Bdate, which stores the birth date and Jdate, which stores the joining date of an employee. Write commands to find out and display the approximate age of an employee as on today.
Find the output of the following SQL Query :
SELECT ROUND(7658.345, 2);
Write the SQL functions which will perform the following operations :
(i) To display the name of the month of the current date.
(ii) To remove spaces from the beginning and end of a string, "Panorama".
(iii) To display the name of the day e.g., Friday or Sunday from your date of birth, dob.
(iv) To display the starting position of your first name(fname) from your whole name (name).
(v) To compute the remainder of division between two numbers, n1 and n2.
Write suitable SQL query for the following :
(i) Display 7 characters extracted from 7th left character onwards from the string 'INDIA SHINING'.
(ii) Display the position of occurrence of string 'COME' in the string 'WELCOME WORLD'.
(iii) Round off the value 23.78 to one decimal place.
(iv) Display the remainder of 100 divided by 9.
(v) Remove all the expected leading and trailing spaces from a column userid of the table 'USERS'.