SQL > SQL Functions > ROUND Function

The ROUND function in SQL is used to round a number to a specified precision.

ROUND(expression, decimal_place) rounds a number to the given number of decimal places — use a positive value to round to the right of the decimal point, or a negative value to round to tens, hundreds, etc.

Syntax

The syntax for the ROUND function is,

ROUND (expression, [decimal place])

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.

Examples

We use the following table for our examples.

Table Student_Rating

  Column Name    Data Type  
  StudentID    integer  
  First_Name    char(20)  
  Rating    float  

and this table contains the following rows:

Table Student_Rating

 StudentID  First_Name  Rating 
1Jenny 85.235 
2Bob 92.52 
3Alice 3.9 
4James 120.1 

Example 1: Decimal place is positive

To round to the nearest tenths place, we use the following SQL:

SELECT First_Name, ROUND (Rating, 1) Rounded_Score FROM Student_Rating;

Result:

First_Name   Rounded_Score
Jenny   85.2
Bob   92.5
Alice   3.9
James   120.1

Example 2: Decimal place is negative

To round to the nearest tens place, we use the following SQL:

SELECT First_Name, ROUND (Rating, -1) Rounded_Score FROM Student_Rating;

Result:

First_Name   Rounded_Score
Jenny   90
Bob   90
Alice   0
James   120

Frequently Asked Questions

What does the SQL ROUND function do?
ROUND(expression, decimal_place) rounds a numeric value to the specified number of decimal places. A positive decimal_place rounds to the right of the decimal; a negative value rounds to the left (e.g., -1 rounds to the nearest ten).
What happens when decimal_place is negative?
A negative decimal_place rounds to a position left of the decimal point. ROUND(85, -1) = 90 (rounds to nearest 10). ROUND(150, -2) = 200 (rounds to nearest 100).
What is the difference between ROUND and TRUNCATE?
ROUND adjusts the value to the nearest number at the given precision. TRUNCATE (TRUNC in Oracle) simply drops digits beyond the specified decimal place without rounding. Example: ROUND(85.25, 1) = 85.3, but TRUNCATE(85.25, 1) = 85.2.
Is ROUND supported in all SQL databases?
Yes. ROUND is supported in MySQL, Oracle, SQL Server, PostgreSQL, SQLite, and most other relational databases with the same basic syntax.

Next: SQL String Functions

This page was last updated on March 19, 2026.




Copyright © 2026   1keydata.com   All Rights Reserved     Privacy Policy     About   Contact