考试报名
考试报名
考试内容
考试大纲
在线客服
返回顶部

备考刷题,请到

CDA认证小程序

Which SQL function can round a number?
A. FLOOR
B. CEILING
C. ROUND
D. TRUNCATE
上一题
下一题
收藏
点赞
评论
题目解析
题目评论(0)

floor(x) returns the largest integer less than x (round down), ceiling(x) returns the smallest integer greater than x (round up), round(x,y) returns x rounded to y decimal places (round to nearest), truncate(x,y) truncates x to y decimal places.

正确答案是:C: ROUND。

专业分析:
- `FLOOR` 函数用于返回小于或等于指定数值的最大整数。例如,`FLOOR(2.9)` 会返回 `2`。
- `CEILING` 函数用于返回大于或等于指定数值的最小整数。例如,`CEILING(2.1)` 会返回 `3`。
- `ROUND` 函数用于将数值四舍五入到指定的小数位数。例如,`ROUND(2.567, 2)` 会返回 `2.57`。
- `TRUNCATE` 函数用于截断数值到指定的小数位数,而不是四舍五入。例如,`TRUNCATE(2.567, 2)` 会返回 `2.56`。

因此,`ROUND` 函数是用于四舍五入一个数值的正确选项。