Playback starts YouTube’s embedded player (privacy-enhanced mode).
05 MySQL Tutorial for Beginners: Arithmetic Expressions, AS: Column Alias
ChannelgolearnfastDescription from the creator
In the SELECT clause, you can code an expression that include one or more arithmetic operators.
An expression is a combination of column names, numbers and operators and evaluates to a single value.
There are several arithmetic operators you can use in the arithmetic expressions (addition, subtraction, multiplication, division, integer division and modulo)
In mathematics "order of precedence" is a rule used to clarify which procedures should be performed first in a given mathematical expression.
In arithmetic expressions, MySQL performs multiplication, division, DIV and MOD operations first.
Then, it performs addition and subtraction operations. The operations in an expression are performed from left to right.
You can use parentheses in an expression, to specify how an expression is evaluated and override the order of precedence rule.
MySQL evaluates the expressions in the innermost sets of parentheses first, followed by the expressions in outer sets of parentheses.
Within each set of parentheses, MySQL evaluates the expression from left to right in the order of precedence.
By default, a column in the result set is given the same name as the column in the base table.
If the column is based on a calculated value, MySQL uses the expression for the calculated value as the column name.
Since the expressions for many calculated values can be cumbersome you can specify a substitute name known as a "column alias" for the column.
To assign a column alias, you code the column specification followed by the AS keyword and the new name.
Although the AS keyword is optional, it’s recommend you code it for readability.
To include a space in the alias you can enclose that alias in single quotes.
EXERCISES for your SELF-TRAINING:
golearnfast.com/Quizzes.php?_SelectSmallerGroup…
SCRIPT FOR THE EXAMPLES:
golearnfast.com/files/lessons_material/lesson_2…
SUBSCRIBE!
youtube.com/channel/UCMEaGDoHU7c9tWyafZ9vC6Q?su…
FACEBOOK
facebook.com/golearnfast
GOOGLE+
plus.google.com/u/0/b/101326338689489366802/
An expression is a combination of column names, numbers and operators and evaluates to a single value.
There are several arithmetic operators you can use in the arithmetic expressions (addition, subtraction, multiplication, division, integer division and modulo)
In mathematics "order of precedence" is a rule used to clarify which procedures should be performed first in a given mathematical expression.
In arithmetic expressions, MySQL performs multiplication, division, DIV and MOD operations first.
Then, it performs addition and subtraction operations. The operations in an expression are performed from left to right.
You can use parentheses in an expression, to specify how an expression is evaluated and override the order of precedence rule.
MySQL evaluates the expressions in the innermost sets of parentheses first, followed by the expressions in outer sets of parentheses.
Within each set of parentheses, MySQL evaluates the expression from left to right in the order of precedence.
By default, a column in the result set is given the same name as the column in the base table.
If the column is based on a calculated value, MySQL uses the expression for the calculated value as the column name.
Since the expressions for many calculated values can be cumbersome you can specify a substitute name known as a "column alias" for the column.
To assign a column alias, you code the column specification followed by the AS keyword and the new name.
Although the AS keyword is optional, it’s recommend you code it for readability.
To include a space in the alias you can enclose that alias in single quotes.
EXERCISES for your SELF-TRAINING:
golearnfast.com/Quizzes.php?_SelectSmallerGroup…
SCRIPT FOR THE EXAMPLES:
golearnfast.com/files/lessons_material/lesson_2…
SUBSCRIBE!
youtube.com/channel/UCMEaGDoHU7c9tWyafZ9vC6Q?su…
facebook.com/golearnfast
GOOGLE+
plus.google.com/u/0/b/101326338689489366802/
About this tutorial
golearnfast published this 11:41 video tutorial on November 11, 2015. It has been watched 6,824 times on YouTube.
- Channel
- golearnfast
- Category
- Education
- Duration
- 11:41
- Published
- November 11, 2015
- Views
- 6,824
- Likes
- 41
Tags
Share
This tutorial in other languages
- FR05 Tutoriel MySQL pour les débutants: expressions arithmétiques, AS: colonne Alias
- ES05 MySQL Tutorial para principiantes: expresiones aritméticas, AS: alias de columna
- PT05 MySQL Tutorial para Iniciantes: expressões aritméticas, AS: Alias Column
- IT05 MySQL Tutorial per principianti: espressioni aritmetiche, AS: Alias Colonna
- DE05 MySQL Tutorial für Anfänger: arithmetische Ausdrücke, AS: Spalte Alias
- NL05 MySQL Tutorial voor beginners: rekenkundige expressies, AS: Column Alias
- RU05 MySQL Учебник для начинающих: Арифметические выражения, AS: Колонка Алиас
- PL05 MySQL Tutorial dla początkujących: wyrażeń arytmetycznych, AS: Kolumna Alias
- JA初心者のための05のMySQLチュートリアル:算術式、AS:列の別名
- AR05 ماي دروس للمبتدئين: الحساب التعبير، AS: الاسم المستعار العمود
- HIशुरुआती 05 MySQL ट्यूटोरियल: अंकगणित भाव, के रूप में: कॉलम उर्फ
- ID05 MySQL Tutorial untuk Pemula: Arithmetic Expressions, AS: Alias Kolom