15/08/2022 09:50 SQL Functions
☰
HTML CSS JAVASCRIPT
w3schools.com
THE WORLD'S LARGEST WEB DEVELOPER SITE
SQL Functions
« Previous Next Chapter »
SQL has many built-in functions for performing calculations on data.
SQL Aggregate Functions
SQL aggregate functions return a single value, calculated from values in a column.
Useful aggregate functions:
AVG() - Returns the average value
COUNT() - Returns the number of rows
FIRST() - Returns the first value
LAST() - Returns the last value
MAX() - Returns the largest value
MIN() - Returns the smallest value
SUM() - Returns the sum
SQL Scalar functions
SQL scalar functions return a single value, based on the input value.
Useful scalar functions:
UCASE() - Converts a field to upper case
LCASE() - Converts a field to lower case
MID() - Extract characters from a text field
LEN() - Returns the length of a text field
ROUND() - Rounds a numeric field to the number of decimals specified
www-db.deis.unibo.it/courses/TW/DOCS/w3schools/sql/sql_functions.asp.html#gsc.tab=0 1/4
15/08/2022 09:50 SQL Functions
NOW() - Returns the current system date and time
☰
HTML CSS JAVASCRIPT
FORMAT() - Formats how a field is to be displayed
Tip: The aggregate functions and the scalar functions will be explained in details in the
next chapters.
« Previous Next Chapter »
W3SCHOOLS EXAMS
HTML, CSS, JavaScript, PHP, jQuery, Bootstrap and XML Certifications
COLOR PICKER
colorpicker
LEARN MORE:
Color Converter
Google Maps
Animated Buttons
Modal Boxes
Modal Images
Tooltips
Loaders
JS Animations
Progress Bars
Dropdowns
Slideshow
Side Navigation
HTML Includes
Color Palettes
Code Coloring
SHARE THIS PAGE
www-db.deis.unibo.it/courses/TW/DOCS/w3schools/sql/sql_functions.asp.html#gsc.tab=0 2/4
15/08/2022 09:50 SQL Functions
☰
HTML CSS JAVASCRIPT
REPORT ERROR
PRINT PAGE
FORUM
ABOUT
Top 10 Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
SQL Tutorial
PHP Tutorial
jQuery Tutorial
Angular Tutorial
XML Tutorial
Top 10 References
HTML Reference
CSS Reference
JavaScript Reference
W3.CSS Reference
Browser Statistics
PHP Reference
HTML Colors
HTML Character Sets
jQuery Reference
AngularJS Reference
Top 10 Examples
HTML Examples
CSS Examples
JavaScript Examples
W3.CSS Examples
HTML DOM Examples
PHP Examples
jQuery Examples
ASP Examples
XML Examples
SVG Examples
Web Certificates
HTML Certificate
HTML5 Certificate
CSS Certificate
www-db.deis.unibo.it/courses/TW/DOCS/w3schools/sql/sql_functions.asp.html#gsc.tab=0 3/4
15/08/2022 09:50 SQL Functions
JavaScript Certificate
☰
HTML CSS JAVASCRIPT
jQuery Certificate
PHP Certificate
Bootstrap Certificate
XML Certificate
W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and
basic understanding.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot
warrant full correctness of all content.
While using this site, you agree to have read and accepted our terms of
use,
cookie and privacy policy.
Copyright 1999-2016 by Refsnes Data. All Rights Reserved.
Powered by W3.CSS.
W3Schools.com
www-db.deis.unibo.it/courses/TW/DOCS/w3schools/sql/sql_functions.asp.html#gsc.tab=0 4/4