FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sql-ultimate-course/scripts/08_Number_Functions.sql at main · Vevek-github/sql-ultimate-course · GitHub
Vevek-github
/
sql-ultimate-course
Public
forked from
DataWithBaraa/sql-ultimate-course
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sql-ultimate-course
/
scripts
/
08_Number_Functions.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (29 loc) · 1.28 KB
Breadcrumbs
sql-ultimate-course
/
scripts
/
08_Number_Functions.sql
Copy path
File metadata and controls
34 lines (29 loc) · 1.28 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
==============================================================================
SQL Number Functions Guide
-------------------------------------------------------------------------------
This document provides an overview of SQL number functions, which allow
performing mathematical operations and formatting numerical values.
Table of Contents:
1. Rounding Functions
- ROUND
2. Absolute Value Function
- ABS
=================================================================================
*/
/*
==============================================================================
ROUND() - Rounding Numbers
===============================================================================
*/
--
Demonstrate rounding a number to different decimal places
SELECT
3
.
516
AS
original_number,
ROUND(
3
.
516
,
2
)
AS
round_2,
ROUND(
3
.
516
,
1
)
AS
round_1,
ROUND(
3
.
516
,
0
)
AS
round_0
/*
==============================================================================
ABS() - Absolute Value
===============================================================================
*/
--
Demonstrate absolute value function
SELECT
-
10
AS
original_number,
ABS(
-
10
)
AS
absolute_value_negative,
ABS(
10
)
AS
absolute_value_positive
Back
|
FazBrowse Home
|
New Git URL