SlideShare a Scribd company logo
1 of 21
By : Dhirendra Chauhan
Numeric
Functions
ABS() Function
“The ABS() function returns the absolute
(positive) value of a number”
Syntax :
Select ABS(number);
Example
Select ABS(-9);
Output: 9
CEIL( ) / CEILING( ) Function
“The CEIL() function returns the smallest integer
value that is bigger than or equal to a number.”
Syntax
SELECT CEIL(number);
Example
SELECT CEIL(25.75);
Output : 26
Example
SELECT CEIL(25.75);
SELECT CEIL(25.00);
SELECT CEIL(-25.01);
SELECT CEIL(-25.99);
Output
26
25
-25
-25
FLOOR( ) Function
“The FLOOR() function returns the largest integer
value that is smaller than or equal to a number.
Syntax
SELECT FLOOR(number);
Example
SELECT FLOOR(25.75);
Output : 25
Example
SELECT Floor(25.75);
SELECT Floor (25.00);
SELECT Floor (-25.01);
SELECT Floor (-25.99);
Output
25
25
-26
-26
MOD( ) Function
“The MOD() function returns the remainder of a number
divided by another number.”
Syntax
SELECT MOD( M , N );
Example
SELECT MOD(18, 4);
Output : 2
POW( )/ POWER() Function
“The POW() function returns the value of a number raised to
the power of another number.”
Syntax:
SELECT POW(x, y);
Example
SELECT POW(4, 2);
Output :
x y
4 2
4 * 4 = 16
ROUND() Function
The ROUND() function rounds a number to a specified
number of decimal places
Syntax:
SELECT ROUND(number, decimals);
Example
SELECT ROUND(135.375, 2);
Example output
1. SELECT ROUND (135.375, 3); 135.375
2. SELECT ROUND (135.375, 2); 135.38
3. SELECT ROUND (135.375, 1); 135.4
4. SELECT ROUND (135.375, 0); 135
5. SELECT ROUND (135.375, -1); 140
6. SELECT ROUND (135.375, -2); 100
7. SELECT ROUND (135.375, -3); 0
TRUNCATE( ) Function
The TRUNCATE() function truncates a number to the
specified number of decimal places.
Syntax:
SELECT TRUNCATE(number, decimals);
Example
SELECT TRUNCATE(135.375, 2);
Example output
1. SELECT TRUNCATE(135.375, 3); 135.375
2. SELECT TRUNCATE(135.375, 2); 135.37
3. SELECT TRUNCATE(135.375, 1); 135.3
4. SELECT TRUNCATE(135.375, 0); 135
5. SELECT TRUNCATE(135.375, -1); 130
6. SELECT TRUNCATE(135.375, -2); 10
7. SELECT TRUNCATE(135.375, -3); 0
SQRT() Function
The SQRT() function returns the square root of a number.
Syntax:
SELECT SQRT(Number);
Example
SELECT SQRT(9);
Output : 3
SIGN() Function
The SIGN() function returns the sign of a number.
This function will return one of the following:
If number > 0, it returns 1
If number = 0, it returns 0
If number < 0, it returns -1
Syntax Example
SELECT SIGN(Number); SELECT SIGN(255.5);
Output : 1
RAND() Function
The RAND() function returns a random number between 0
(inclusive) and 1 (exclusive)
Syntax:
SELECT RAND(Number);
Example
SELECT RAND(5);
Output : 0.4
RADIANS() Function
The RADIANS() function converts a degree value
into radians.
Syntax:
SELECT RADIANS(Number);
Example
SELECT RADIANS(180);
Output : 3.14
DEGREES( ) Function
“The DEGREES() function converts a value in radians
to degrees.
Syntax
SELECT DEGREES(radians);
Example
SELECT DEGREES(1.5);
Output : 85.95
GREATEST() Function
The GREATEST() function returns the greatest value of the
list of arguments
Syntax:
SELECT GREATEST (arg1, arg2, arg3, ...);
Example
SELECT GREATEST(3, 12, 34, 8, 25);
Output : 34
LEAST( ) Function
The LEAST() function returns the smallest value of the list
of arguments.
Syntax
SELECT LEAST(arg1, arg2, arg3, ...);
Example
SELECT LEAST(3, 12, 34, 8, 25);
Output : 3
THANK
YOU

More Related Content

What's hot

What's hot (20)

week-1x
week-1xweek-1x
week-1x
 
week-6x
week-6xweek-6x
week-6x
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
week-11x
week-11xweek-11x
week-11x
 
C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5
 
Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++
 
week-10x
week-10xweek-10x
week-10x
 
Mathematics Function in C ,ppt
Mathematics Function in C ,pptMathematics Function in C ,ppt
Mathematics Function in C ,ppt
 
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
 
Advanced pointer
Advanced pointerAdvanced pointer
Advanced pointer
 
Expression evaluation
Expression evaluationExpression evaluation
Expression evaluation
 
Stack using Linked List
Stack using Linked ListStack using Linked List
Stack using Linked List
 
Built in functions
Built in functionsBuilt in functions
Built in functions
 
week-18x
week-18xweek-18x
week-18x
 
Application of Stacks
Application of StacksApplication of Stacks
Application of Stacks
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
 
Sketching derivatives
Sketching derivativesSketching derivatives
Sketching derivatives
 
matlab code of shifting and folding of two sequences
matlab code of shifting and folding of two sequencesmatlab code of shifting and folding of two sequences
matlab code of shifting and folding of two sequences
 
Lec21-CS110 Computational Engineering
Lec21-CS110 Computational EngineeringLec21-CS110 Computational Engineering
Lec21-CS110 Computational Engineering
 
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)High Order Function Computations in c++14 (C++ Dev Meetup Iasi)
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)
 

Similar to V34 numeric function-c

Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functionsVineeta Garg
 
Database Query Using SQL_ip.docx
Database Query Using SQL_ip.docxDatabase Query Using SQL_ip.docx
Database Query Using SQL_ip.docxVandanaGoyal21
 
Intro to tsql unit 10
Intro to tsql   unit 10Intro to tsql   unit 10
Intro to tsql unit 10Syed Asrarali
 
Sql intro
Sql introSql intro
Sql introglubox
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IOT Academy
 
Unit 3 - Function & Grouping,Joins and Set Operations in ORACLE
Unit 3 - Function & Grouping,Joins and Set Operations in ORACLEUnit 3 - Function & Grouping,Joins and Set Operations in ORACLE
Unit 3 - Function & Grouping,Joins and Set Operations in ORACLEDrkhanchanaR
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoThe Software House
 
MS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Doing Calculations With FunctionsMS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Doing Calculations With Functionssqlserver content
 
MS SQL SERVER: Doing Calculations With Functions
MS SQL SERVER: Doing Calculations With FunctionsMS SQL SERVER: Doing Calculations With Functions
MS SQL SERVER: Doing Calculations With Functionssqlserver content
 
MS Sql Server: Doing Calculations With Functions
MS Sql Server: Doing Calculations With FunctionsMS Sql Server: Doing Calculations With Functions
MS Sql Server: Doing Calculations With FunctionsDataminingTools Inc
 
MySQL-commands.pdf
MySQL-commands.pdfMySQL-commands.pdf
MySQL-commands.pdfssuserc5aa74
 
The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.7 book - Part 30 of 196The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.7 book - Part 30 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 16 of 84
The Ring programming language version 1.2 book - Part 16 of 84The Ring programming language version 1.2 book - Part 16 of 84
The Ring programming language version 1.2 book - Part 16 of 84Mahmoud Samir Fayed
 

Similar to V34 numeric function-c (20)

Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functions
 
Database Query Using SQL_ip.docx
Database Query Using SQL_ip.docxDatabase Query Using SQL_ip.docx
Database Query Using SQL_ip.docx
 
Intro to tsql unit 10
Intro to tsql   unit 10Intro to tsql   unit 10
Intro to tsql unit 10
 
Les03
Les03Les03
Les03
 
Computer practical
Computer practicalComputer practical
Computer practical
 
Sql intro
Sql introSql intro
Sql intro
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
 
ORACLE NOTES
ORACLE NOTESORACLE NOTES
ORACLE NOTES
 
Unit 3 - Function & Grouping,Joins and Set Operations in ORACLE
Unit 3 - Function & Grouping,Joins and Set Operations in ORACLEUnit 3 - Function & Grouping,Joins and Set Operations in ORACLE
Unit 3 - Function & Grouping,Joins and Set Operations in ORACLE
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duo
 
Les03 Single Row Function
Les03 Single Row FunctionLes03 Single Row Function
Les03 Single Row Function
 
MS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Doing Calculations With FunctionsMS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Doing Calculations With Functions
 
MS SQL SERVER: Doing Calculations With Functions
MS SQL SERVER: Doing Calculations With FunctionsMS SQL SERVER: Doing Calculations With Functions
MS SQL SERVER: Doing Calculations With Functions
 
MS Sql Server: Doing Calculations With Functions
MS Sql Server: Doing Calculations With FunctionsMS Sql Server: Doing Calculations With Functions
MS Sql Server: Doing Calculations With Functions
 
MySQL-commands.pdf
MySQL-commands.pdfMySQL-commands.pdf
MySQL-commands.pdf
 
Sql operators & functions 3
Sql operators & functions 3Sql operators & functions 3
Sql operators & functions 3
 
The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.7 book - Part 30 of 196The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.7 book - Part 30 of 196
 
SQL Keywords
SQL KeywordsSQL Keywords
SQL Keywords
 
The Ring programming language version 1.2 book - Part 16 of 84
The Ring programming language version 1.2 book - Part 16 of 84The Ring programming language version 1.2 book - Part 16 of 84
The Ring programming language version 1.2 book - Part 16 of 84
 
Sql functions
Sql functionsSql functions
Sql functions
 

More from Dhirendra Chauhan (20)

V35 keys-c
V35  keys-cV35  keys-c
V35 keys-c
 
V33 date function-c
V33  date function-cV33  date function-c
V33 date function-c
 
V31 having
V31  havingV31  having
V31 having
 
V30 full join(union intersect etc)
V30  full join(union intersect etc)V30  full join(union intersect etc)
V30 full join(union intersect etc)
 
V29 group by-c
V29  group by-cV29  group by-c
V29 group by-c
 
V28 view
V28  viewV28  view
V28 view
 
V27 constraint
V27 constraintV27 constraint
V27 constraint
 
V26 key
V26 keyV26 key
V26 key
 
V25 sql index
V25 sql indexV25 sql index
V25 sql index
 
V24 cartesion product-c
V24 cartesion product-cV24 cartesion product-c
V24 cartesion product-c
 
V23 function-2
V23 function-2V23 function-2
V23 function-2
 
V22 function-1
V22 function-1V22 function-1
V22 function-1
 
V21 in operator
V21 in operatorV21 in operator
V21 in operator
 
V20 bet ween operator-c
V20 bet ween operator-cV20 bet ween operator-c
V20 bet ween operator-c
 
V19 join method-c
V19 join method-cV19 join method-c
V19 join method-c
 
V18 alias-c
V18 alias-cV18 alias-c
V18 alias-c
 
V17 show command-c
V17 show command-cV17 show command-c
V17 show command-c
 
V16 sql comments-c
V16 sql comments-cV16 sql comments-c
V16 sql comments-c
 
V15 like operator-c
V15 like operator-cV15 like operator-c
V15 like operator-c
 
V3 employment-unemployment
V3 employment-unemploymentV3 employment-unemployment
V3 employment-unemployment
 

Recently uploaded

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Recently uploaded (20)

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

V34 numeric function-c

  • 1. By : Dhirendra Chauhan
  • 3. ABS() Function “The ABS() function returns the absolute (positive) value of a number” Syntax : Select ABS(number); Example Select ABS(-9); Output: 9
  • 4. CEIL( ) / CEILING( ) Function “The CEIL() function returns the smallest integer value that is bigger than or equal to a number.” Syntax SELECT CEIL(number); Example SELECT CEIL(25.75); Output : 26
  • 5. Example SELECT CEIL(25.75); SELECT CEIL(25.00); SELECT CEIL(-25.01); SELECT CEIL(-25.99); Output 26 25 -25 -25
  • 6. FLOOR( ) Function “The FLOOR() function returns the largest integer value that is smaller than or equal to a number. Syntax SELECT FLOOR(number); Example SELECT FLOOR(25.75); Output : 25
  • 7. Example SELECT Floor(25.75); SELECT Floor (25.00); SELECT Floor (-25.01); SELECT Floor (-25.99); Output 25 25 -26 -26
  • 8. MOD( ) Function “The MOD() function returns the remainder of a number divided by another number.” Syntax SELECT MOD( M , N ); Example SELECT MOD(18, 4); Output : 2
  • 9. POW( )/ POWER() Function “The POW() function returns the value of a number raised to the power of another number.” Syntax: SELECT POW(x, y); Example SELECT POW(4, 2); Output : x y 4 2 4 * 4 = 16
  • 10. ROUND() Function The ROUND() function rounds a number to a specified number of decimal places Syntax: SELECT ROUND(number, decimals); Example SELECT ROUND(135.375, 2);
  • 11. Example output 1. SELECT ROUND (135.375, 3); 135.375 2. SELECT ROUND (135.375, 2); 135.38 3. SELECT ROUND (135.375, 1); 135.4 4. SELECT ROUND (135.375, 0); 135 5. SELECT ROUND (135.375, -1); 140 6. SELECT ROUND (135.375, -2); 100 7. SELECT ROUND (135.375, -3); 0
  • 12. TRUNCATE( ) Function The TRUNCATE() function truncates a number to the specified number of decimal places. Syntax: SELECT TRUNCATE(number, decimals); Example SELECT TRUNCATE(135.375, 2);
  • 13. Example output 1. SELECT TRUNCATE(135.375, 3); 135.375 2. SELECT TRUNCATE(135.375, 2); 135.37 3. SELECT TRUNCATE(135.375, 1); 135.3 4. SELECT TRUNCATE(135.375, 0); 135 5. SELECT TRUNCATE(135.375, -1); 130 6. SELECT TRUNCATE(135.375, -2); 10 7. SELECT TRUNCATE(135.375, -3); 0
  • 14. SQRT() Function The SQRT() function returns the square root of a number. Syntax: SELECT SQRT(Number); Example SELECT SQRT(9); Output : 3
  • 15. SIGN() Function The SIGN() function returns the sign of a number. This function will return one of the following: If number > 0, it returns 1 If number = 0, it returns 0 If number < 0, it returns -1 Syntax Example SELECT SIGN(Number); SELECT SIGN(255.5); Output : 1
  • 16. RAND() Function The RAND() function returns a random number between 0 (inclusive) and 1 (exclusive) Syntax: SELECT RAND(Number); Example SELECT RAND(5); Output : 0.4
  • 17. RADIANS() Function The RADIANS() function converts a degree value into radians. Syntax: SELECT RADIANS(Number); Example SELECT RADIANS(180); Output : 3.14
  • 18. DEGREES( ) Function “The DEGREES() function converts a value in radians to degrees. Syntax SELECT DEGREES(radians); Example SELECT DEGREES(1.5); Output : 85.95
  • 19. GREATEST() Function The GREATEST() function returns the greatest value of the list of arguments Syntax: SELECT GREATEST (arg1, arg2, arg3, ...); Example SELECT GREATEST(3, 12, 34, 8, 25); Output : 34
  • 20. LEAST( ) Function The LEAST() function returns the smallest value of the list of arguments. Syntax SELECT LEAST(arg1, arg2, arg3, ...); Example SELECT LEAST(3, 12, 34, 8, 25); Output : 3