Hướng dẫn thử thách
1 / 112
ABS
### Giai đoạn: Nền Tảng & Khái Niệm Cốt Lõi
**ABS**
The `ABS()` function in SQL returns the absolute value of a given numeric expression, meaning it converts any negative number to its positive equivalent while leaving positive numbers unchanged. This function is useful when you need to ensure that the result of a calculation or a value stored in a database column is non-negative, such as when calculating distances, differences, or other metrics where only positive values make sense. For example, `SELECT ABS(-5)` would return `5`.
### Khái niệm cốt lõi:
1. **For example, `SELECT ABS(-5)` would return `5`**
### Tài liệu tham khảo chính thống:
- [How to compute an absolute value in SQL](https://www.airops.com/sql-guide/how-to-compute-an-absolute-value-in-sql) (article)
- [ABS](https://www.w3schools.com/sql/func_sqlserver_abs.asp) (article)
Nhiệm vụ của bạn
Viết giải pháp của bạn cho bài học **ABS** vào trình soạn thảo bên cạnh. Bấm **Chạy Thử Nghiệm** (hoặc nhấn `Ctrl+Enter`) để thực thi và ghi nhận hoàn thành kỹ năng trên Roadmap.
### Kỹ năng cần đạt:
- `ABS`
- `Core`
- `Engineering`
Vượt qua bài kiểm tra hiện tại để mở khóa bài tiếp theo.
main.sql
UTF-8 • Tab Size: 2Kiểm tra bài:⌘↵