The ROUND function in SQL is used to round a number to a specified precision.
The syntax for the ROUND function is,
where [decimal place] indicates the number of decimal points returned. A negative number means the rounding will occur to a digit to the left of the decimal point. For example, -1 means the number will be rounded to the nearest tens.
We use the following table for our examples.
Table Student_Rating
and this table contains the following rows:
Table Student_Rating
To round to the nearest tenths place, we use the following SQL:
Result:
To round to the nearest tens place, we use the following SQL:
Result:
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.