Page 104 - Computer Software Application TP - Volume 1
P. 104
COMPUTER SOFTWARE APPLICATION - CITS
EXERCISE 28: Using the Number, Date and Character
Functions
Objectives
At the end of this exercise you shall be able to
• use the number functions in MySQL
• use the data functions in MySQL
• use the character functions in MySQL
Requirements
Tools/Materials
• Desktop/Laptop with latest configuration
• Operating system: window 10:11
• XAMPP server r3.3.0
Procedure
TASK 1 :Using Number Functions:
1 ABS() – Absolute Value:
SELECT ABS(-15);
-- Result: 15
2 ROUND() - Round to specified numbers of decimal places.
SELECT ROUND(123.456, 2);
-- Result: 123.46
3 SUM() – Calculate the sum of the values
SELECT SUM(column name) FROM your table;
89
CITS : IT & ITES - Computer Software Application - Exercise 27